Regex look behind in VS Code?

You can use infinite-width lookahead and lookbehind without any constraint now beginning with Visual Studio Code v.1.31.0 release.

See proof:

enter image description here

and another one (with (?<=@fmt\([^()]*)\w+ pattern, note the * in the lookbehind):

enter image description here

See the Github [VSCode 1.31] ES2018 RegExp lookbehind assertions are now supported #68004 issue:

As a result of moving to Electron 3.0, RegExp lookbehind assertions are now supported, since they’re supported since Chromium 62 and Node 8.10.0, and Electron 3.0 uses Chromium 66 and Node 10.2.0, so they’re now supported, but the release notes don’t mention that lookbehind assertions are now supported.

VS Code developers confirm that it is true that they “forgot to mention it in the release notes”.

Leave a Comment