Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Diagramming regular expressions

Last post 10-12-2008, 10:13 PM by ddrudik. 4 replies.
Sort Posts: Previous Next
  •  10-04-2008, 11:25 PM 46882

    Diagramming regular expressions

    I recently discovered the GraphViz::Regex Perl module for diagramming regular expressions:

    http://search.cpan.org/~lbrocard/GraphViz-2.03/lib/GraphViz/Regex.pm

    I have added that functionality to my online regex tester at http://www.myregextester.com/

    Simply check the box "DIAGRAM" before submitting your pattern in the tester.

    Unlike the saved examples, diagrams are kept on a temporary basis only (currently removed daily).  However, if you save an example with the "DIAGRAM" checkbox selected it will recreate the diagram when recalled.

    The diagrams are returned in PNG format.

    There are likely a number of unforseen issues with the module's interpretation of regex syntax, unfortunately I cannot change it's functionality so it is what it is.  One known issue I would note is that it does not take modifiers into account when creating the diagrams.

    I have also added "WORD LIST" function to the tester using the Regex::PreSuf Perl module:

    http://search.cpan.org/~jhi/Regex-PreSuf-1.17/PreSuf.pm

    It allows for the creation of a match pattern based on a list of words, pattern is somewhat optimized but in my testing the results varied (if you encounter optimization issues using this function, consider using the "OPTIMIZE" checkbox instead and enter a match pattern with the words in your word list separated by | character).

    The "WORD LIST" tool can be found in the "TOOLS:" dropdown list at the site.


  •  10-07-2008, 4:32 AM 46953 in reply to 46882

    Re: Diagramming regular expressions

    Impressive tester ddrudik! I've used it from time to time, didn't even notice it was yours!
  •  10-07-2008, 3:45 PM 46977 in reply to 46953

    Re: Diagramming regular expressions

    prometheuzz, thanks, if there's anything regex-related you think I should add to the site let me know.
  •  10-07-2008, 3:56 PM 46978 in reply to 46977

    Re: Diagramming regular expressions

    ddrudik:
    prometheuzz, thanks, if there's anything regex-related you think I should add to the site let me know.

    I'm not sure if it is already posted on these forums, but I like this little tester:

    http://regex.larsolavtorvik.com/

    Mainly because when you edit your regex, you see the changes in the match(es) in real time: great for testing purposes. The only thing you need to be aware of is that you need to escape the '/' character: that caused quite a bit of head scratching!

    ; )

  •  10-12-2008, 10:13 PM 47114 in reply to 46978

    Re: Diagramming regular expressions

    That was one of the links from the referenced site here:

    http://regexadvice.com/forums/44174/ShowThread.aspx#44174

    There's quite a few good testers out there, each one has its unique features.


View as RSS news feed in XML