Re:Perl 5.26.0 released
by Ardren on Thursday June 01, 2017 @08:20AM
(#14459630)
Javascript has regex literals
Is the same as:
[ Parent
| on HN ]
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+")