Regulex – JavaScript Regular Expression Visualizer
jex.im
jex.im
I find it more useful as it can show how each position of my test string relates to parts of my regular expression
Here's a side by side comparison with the regexp I wrote to parse URLs [0]
Debuggex: https://www.debuggex.com/r/yPBRv77Rxl0Ji3Pi
Regulex: http://jex.im/regulex/#!embed=true&re=^%28https%3F\%3A%29\%2...
Debuggex and regexper are powerful,I agree,that I also hesitate whether there's any reason to publish it.
But I'd like to point out some merits of regulex:
- Regulex is dedicated to ECMAScript RegExp syntax(So I didn't plan to add PCRE support now)
- regexper.com can not point out the syntax error index precisely.(Much JS interpreter can not do that)
- regexper and debuggex both tolerate OctalEscape.
- Regulex can detect invalid backref,which is treated as OctalEscape in Debuggex and regexper.
- Because of OctalEscape's complexity, Debuggex did not parse `(\1)\1\2` correctly ( https://www.debuggex.com/r/_U1r_NxTvLan7h9R ),also regexper.And /^\1(a)$/ will match "a",not "aa".So I treat it as an error.
So at least it can be used to find javascript regex syntax error. ;)
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).
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. ;)
http://jex.im/regulex/#!embed=true&re=(%3F%3A%5Ba-z0-9!%23%2...)
It's neat, simple enough to actually finish it and rewarding enough because people like regexes.
The first one I was exposed to is probably KRegexEditor.
But I think it's non-news otherwise.
I think that on nullable quantifiers (? and (how the fuck do I type a star on the comments)) it misses the optional branch (check http://www.regexper.com/#ab*c vs http://jex.im/regulex/#!embed=false&re=ab*c to see what I mean).
http://jex.im/regulex/#!embed=false&re=(GIR%200AA)%7C(((%5BA-Z-%5BQVX%5D%5D%5B0-9%5D%5B0-9%5D%3F)%7C((%5BA-Z-%5BQVX%5D%5D%5BA-Z-%5BIJZ%5D%5D%5B0-9%5D%5B0-9%5D%3F)%7C((%5BA-Z-%5BQVX%5D%5D%5B0-9%5D%5BA-HJKSTUW%5D)%7C(%5BA-Z-%5BQVX%5D%5D%5BA-Z-%5BIJZ%5D%5D%5B0-9%5D%5BABEHMNPRVWXY%5D))))%20%5B0-9%5D%5BA-Z-%5BCIKMOV%5D%5D%7B2%7D)
edit: the link won't embed here nicelyhttp://jex.im/regulex/#!embed=false&re=%5E(%5B0369%5D%7C%5B1...
It's nice because it automatically detects when your cursor is in a regex and opens a bottom panel. works for js and Python.
Original paper: http://www.cs.sfu.ca/~cameron/REX.html