3 ms·
Here I am still waiting for ES2018 regex look-behinds to be implemented. The folks working on the regex engine must have jumped ship or something.
by fabiospampinato 5y ago
Here I am still waiting for ES2018 regex look-behinds to be implemented. The folks working on the regex engine must have jumped ship or something.
- tgv 5y agoWhat use do you have for that in a web application? Anecdote: I tried (limited) CSS validation to through a regexp some time ago, and it worked, except that Chrome’s implementation jumped from a few 100ms to over 5 minutes on adding a single character. Made the whole thing quite useless.
- olliej 5y agolook behind assertions can be super useful - obviously you can workaround the lack of them, but sometimes simply having them there makes life easier. OTOH get look behind perf to not be horrific is challenging
- thiht 5y agoI recently used a lookbehind to replace \n by \r\n only if it’s not already preceded by \r. It was in a VSCode extension, because the output channel of the testing workbench stupidly requires \r\n, otherwise it doesn’t go to the beginning of the line. I could have done it without a lookbehind but occasions to use it are quite rare to me :)