Group values of regular expression in CoffeeScript
Easy to refer group values of regular expression in CoffeeScript.
Let's say you parse URL, then you can write like this.
[_, path, queryParams] = req.url.match /([^?]+)\?(.*)/
Pretty useful.
Easy to refer group values of regular expression in CoffeeScript.
Let's say you parse URL, then you can write like this.
[_, path, queryParams] = req.url.match /([^?]+)\?(.*)/
Pretty useful.