ECMAScript regular expressions are getting better! No less than FIVE proposals are currently being standardized: https://mathiasbynens.be/notes/es-regexp-proposals …
-
-
Replying to @mathias
that's great! Is there anything in the backlog for composing regexps? Kind of like how perl6 does it
1 reply 0 retweets 1 like -
Replying to @jwajsberg
Isn’t that already possible? E.g. for http://perldoc.perl.org/perlretut.html#Composing-regular-expressions-at-runtime … new RegExp(regexEscape`\\b${cmd}\\w*`, 'g')
2 replies 0 retweets 1 like -
Replying to @mathias
you're refering to perl5 here :) I was refering to perl6's subrules; see https://docs.perl6.org/language/regexes#Subrules … for example
1 reply 0 retweets 1 like -
Replying to @jwajsberg
This is new to me — thanks for sending it over! There’s no such ES proposal yet
3 replies 0 retweets 0 likes -
Replying to @mathias
another thing I miss from Perl (5 this time) is the ability to change the separator from '/' to something else.
2 replies 0 retweets 1 like -
Replying to @jwajsberg
At least that is something you can work around: const pattern = new RegExp(`https://example\\.com/`);
1 reply 0 retweets 0 likes -
Replying to @mathias
yep, but see, even you had it wrong the first time :)
1 reply 0 retweets 2 likes
-
-
Replying to @mathias
IMO we should look at how people use the RegExp constructor and find solutions to accommodate these cases.
2 replies 0 retweets 1 like -
Replying to @jwajsberg @mathias
I'm sure you had "\\\\" in a string because of this already. This is painful :)
0 replies 0 retweets 1 like
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.