Lookbehind regex assertions V8

Published on April 09, 2016

Lookbehind regex assertions V8

    The good news seems to have gone unnoticed.

    V8 developers have been active in adding lookbehind assertions to JavaScript regular expressions.

    In Google Chrome Canary, you can already test using the flag:

    chrome.exe --js-flags="--harmony-regexp-lookbehind"

    This month the sixth version of Node.js is released, based on V8 5.0, and you can also turn on lookbehind support in it:

    node --harmony_regexp_lookbehind

    If you can’t wait at all, you can test on already appearing RC:

    nodejs.org / download / rc

    I tested the positive and negative variants using the example from the article:



    It is worth paying attention to two features mentioned by the authors:

    1. Unlike Perl, both lookbehind variants support variable length expressions.

    2. Developers followed the .NET path and in another feature - an unusual (for starters) order of remembering subexpressions and internal links was established.

    PS The innovation has moved to the --es_staging flag stage .