3 ms·
One of the creators of debuggex here. For javascript, debuggex conforms to the regular expression implementation in google chrome (which is mostly the same as
by tsergiu 12y ago
One of the creators of debuggex here.
For javascript, debuggex conforms to the regular expression implementation in google chrome (which is mostly the same as all other browsers).
Specifically, a \n in your regex where group n doesn't exist is actually interpreted as the octal \00n.
If I recall correctly, \1(a) should match just "a" because all groups start out as being empty.
Parsing regular expressions is indeed complex, and we've got a massive suite of tests to make sure our engine works correctly (with respect to the chrome implementation, since that's what most people are using js regexes for).
- JexCheng 12y agoThank you for the great works of debuggex, I like it. My little tool didn't intend to act like a extreme powerful and multifunctional tool which debuggex is. I know debuggex need to conform existing regex engines,so it will be more useful and can be widely applied. But what my tool intended is another side,trying to point out errors strictly.Such as /\1(a)/ or /(\1)/ doesn't make sense, so I think the ability to report errors like this will be useful.Although js interpreter's regex engine still supports octal today,but I remove it radically(see the project README).Maybe this little feature is useful for someone. ;)