2 ms·
I don't really get the hate for regular regex syntax. And certainly to my eyes, this doesn't look any better to work with that regex. Take the capturing groups
by GordonS 4y ago
I don't really get the hate for regular regex syntax. And certainly to my eyes, this doesn't look any better to work with that regex.
Take the capturing groups sample, is this really meant to be an improvement?!
Rulex:
```
:([s]) :named([.]) ::named
```
Regex:
```
(\s)(?<named>.)\2
```
- Aloso 4y agoNote 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.