Hacker News new | ask | show | jobs
by Aloso 1472 days ago
Note that rulex replaces the named backreference with a numeric one. Named backreferences are much easier to work with, because you don't have to count capturing groups, which is error-prone and complicates later modifications.

An more accurate translation of the above into a (PCRE) regex would be

    (\s)(?P<named>.)\k<named>
However, named backreferences aren't supported in JavaScript. Rulex makes sure that the emitted regex is correct and supported by the target regex flavor.