4 ms·
One thing that annoys me a bit about the JS syntax though: As far as I know, JS regexp literals don't have custom delimiter support. For instance in perl you ca
by hoytech 9y ago
One thing that annoys me a bit about the JS syntax though: As far as I know, JS regexp literals don't have custom delimiter support. For instance in perl you can do this:
$str =~ m{/some/path/\w+}
But in JS you need to escape the / characters, or use a normal string as an argument to Regexp, in which case you need to escape the backslashes:
/\/some\/path\/\w+/
Regexp("/some/path/\\w+")