Live data from Hacker News

Regexper – Regular expressions visualizer

regexper.com

21–30 of 108 posts

Re: Regexper – Regular expressions visualizer

#21
This is a nifty tool, and to be honest I was unaware that regex visualization was a thing before now. I usually write comments in BNF next to my regex, so that I can make sense of them later. I'm going to keep doing that, but visualization is going to be great for debugging and for figuring out other people's less carefully commented regex.

Re: Regexper – Regular expressions visualizer

#22
post #5

Nice. From this SO answer: https://stackoverflow.com/a/800847/415384 we get this: https://regexper.com/#%5E(%3F%3A(%3F%3A(%3F%3A0%3F%5B13578%5... or from another answer: https://regexper.com/#((1%7C0(00)*01)((11%7C10(00)*01))*%7C(... )

That last link shows an error.

Re: Regexper – Regular expressions visualizer

#23
post #5

Nice. From this SO answer: https://stackoverflow.com/a/800847/415384 we get this: https://regexper.com/#%5E(%3F%3A(%3F%3A(%3F%3A0%3F%5B13578%5... or from another answer: https://regexper.com/#((1%7C0(00)*01)((11%7C10(00)*01))*%7C(... )

That last link shows an error.

Add ')' at the very end (you can see it is not included in the clickable link and it's also what the error says).

Re: Regexper – Regular expressions visualizer

#24
post #5

Nice. From this SO answer: https://stackoverflow.com/a/800847/415384 we get this: https://regexper.com/#%5E(%3F%3A(%3F%3A(%3F%3A0%3F%5B13578%5... or from another answer: https://regexper.com/#((1%7C0(00)*01)((11%7C10(00)*01))*%7C(... )

That last link shows an error.

[deleted]

Re: Regexper – Regular expressions visualizer

#25
post #16

The Email::Valid Perl distribution ships with a more than 6000 character regex to validate E-Mail addresses. Both goo.gl and bit.ly refused to shorten it, and when I tried to paste the link here HN refused to accept my comment. But on a machine with Email::Valid installed do: perl -MEmail::Valid -wE 'say $Email::Valid::RFC822PAT' And copy the output into the Regexper form. It takes a while to render, but it'll eventu…

>Both goo.gl and bit.ly refused to shorten it, and when I tried to paste the link here HN refused to accept my comment.

github gist?

Re: Regexper – Regular expressions visualizer

#27
post #2

Neat! I also suggest: https://regexr.com/

That is cool. https://www.debuggex.com/ has nice visualization.

Wow, that is really cool.

I actually started typing in random characters and tracing the matches through the graph for the Regex from StackOverflow mentioned earlier. I didn't know what the regex matches, so I played it like a game , trying to reach the finish by typing one character at a time.

When I finished, I saw that I had typed "01/31/1691" and then realised that it's a regex for dates.

Re: Regexper – Regular expressions visualizer

#30
post #16

The Email::Valid Perl distribution ships with a more than 6000 character regex to validate E-Mail addresses. Both goo.gl and bit.ly refused to shorten it, and when I tried to paste the link here HN refused to accept my comment. But on a machine with Email::Valid installed do: perl -MEmail::Valid -wE 'say $Email::Valid::RFC822PAT' And copy the output into the Regexper form. It takes a while to render, but it'll eventu…

Wow. Despite the utterly insane complexity of a regex of that size, it doesn't seem to do an insane amount of branching. Maximum depth of choices seems to be about 4, which is less than a lot of other regex examples I've seen here.

That being said... That regex is just noise. Nobody can tackle it all at once or by themselves, unless they specialise in just regex. It's 6599 characters, at least on my system. So at a wild stab, its the equivalent of 4,500 lines of obfuscated code.

You can't audit it, you just kinda have to trust it, and hope.

But with something like regexper, I can at least read it.

Post reply on HN