I wish I had it when I was a CS professor in 2004-2006, teaching Compilers to 2nd year university students. They would have found it really useful.
[bc]*(cd)+
doesn't seem to match cbcdcd
Nor does the simpler a*(ab)
match aab
But a*ab
matches aab.P.S. The whole split() thing you do is an interesting hack to not have to preserve/rewind so much state. :D I've never quite seen fork() used so...
^((?:(?:https?|ftps?):\/\/)|irc:\/\/|mailto:)([\w?!~^\/\\#$%&'()*+,\-.\/:;<=@]*[\w~^\/\\#$%&'()*+,\-\/:;<=@])
and it seems to fail to visualize it.Edit: Actually, since the non-capturing group part doesn't add much here, you can just remove the '?:'s and this works:
https://blog.robertelder.org/regular-expression-visualizer/?...
https://blog.robertelder.org/regular-expression-parser-gramm...
I may add to it in the future if there is enough interest. At the moment it doesn't support a few common things like word breaks and backreferences, but I don't think it'd be too hard to add.