News for hackers. Stuff that matters.
Re:Regexper: Beautiful regexp visualizations by robomartin on Wednesday January 02, 2013 @12:40PM (#4997890)
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:

    <a.*?>([^<]*)<\/a>
http://gskinner.com/RegExr/?339m7

or

http://rubular.com/r/pCXZs0DnSS

take your pick, same results.

If you remove the "?" from the regex you'll get different results.

One version selects all anchor tags individually and make a selection group of their contents and the other version ends-up selecting everything between the first opening anchor tag and the last closing anchor tag into the selection group except for "<" characters.

The graph in Regexper does not show any difference between the two expressions even when any one of these forms is used:

    #<a.*>([^<]*)</a>#msi
    
    #<a.*>([^<]*)</a>#gsi
    
    /<a.*>([^<]*)<\/a>/msi
    
    /<a.*>([^<]*)</a>/gsi
It looks like the flags are not being processed.

Also, please change the textbox to a fixed width font.

In addition to that, regex authoring tools, ultimately, are only useful if you can also enter some input text and see the result, preferably in real-time.

Other than that, it's an interesting concept.

Re:Regexper: Beautiful regexp visualizations by mlacitation on Wednesday January 02, 2013 @01:12PM (#4998134)
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...