Live data from Hacker News

Regexper: Beautiful regexp visualizations

regexper.com

41–50 of 132 posts

Re: Regexper: Beautiful regexp visualizations

#42
post #7

I tried the most complicated regular expression in the world: http://ex-parrot.com/~pdw/Mail-RFC822-Address.html and the server 500'd. Just joking, it's a very good tool. P.S. it crashed with three nested groups (((a*)))

As an aside. I quit using regex to validate email addresses a while ago. Part of it is that a regex that large is simply incomprehensible and very difficult to maintain and fix if something is broken. The best solution, in my opinion, is a state machine based analyzer that checks the email address character-by-character and confirms compliance with RFC5322. This would also include checking DNS for MX records (which might require following CNAME to find it).

Re: Regexper: Beautiful regexp visualizations

#45

The parser is failing for regexps containg the caret or dollar chars: http://cl.ly/image/3q0B2X1F3i1H http://cl.ly/image/171f172x0P1M

You need to remove the slashes from that example

Ha, thanks. Old habits die hard.

Re: Regexper: Beautiful regexp visualizations

#46

Interesting concept. As with all regex related online tools, it is important to test exhaustively before trusting it. Real-time character-by-character output would be important. If you are working on a long regex expression real-time output can help you think like the FSA and see how it behaves. Here's an example of this tool failing: ([^ http://gskinner.com/RegExr/?339m7 or http://rubular.com/r/pCXZs0DnSS take your…

With regards to the real-time analysis, you might find perl's Regexp::Debugger fun to use:

http://search.cpan.org/~dconway/Regexp-Debugger-0.001011/lib...

That's the documentation for using the module in your code. If you're interested in the standalone tool, you'll want rxrx:

http://search.cpan.org/~dconway/Regexp-Debugger-0.001011/bin...

Re: Regexper: Beautiful regexp visualizations

#47

Hello, I'm the creator of this (trevmex is one of my co-workers). I just want to thank everyone for the feedback so far, I am looking into the issues that have been brought up (they'll have to wait until this evening to be fixed though...I have a day job).

Neat tool, I like how clear the visualizations are. It didn't work for me under Chrome on OSX, though. Chrome Version 23.0.1271.101, OSX 10.7.5.

Re: Regexper: Beautiful regexp visualizations

#49
This is great. Has this approach to visualizing loops and structures been tried with general programs? Indentation and color coding seems to be the limit to the visual expressiveness in most IDEs because they tend to stay withing the format of plain text files.

I'd really like to see some more creative visuals like this for making program structure visible.

Re: Regexper: Beautiful regexp visualizations

#50

This is great. Has this approach to visualizing loops and structures been tried with general programs? Indentation and color coding seems to be the limit to the visual expressiveness in most IDEs because they tend to stay withing the format of plain text files. I'd really like to see some more creative visuals like this for making program structure visible.

I don't know if there's a name for this style of display, but it's the same as the way JSON is depicted on its official site. http://www.json.org

Edit: It's called a Railroad Diagram.

Post reply on HN