Hacker News new | past | comments | ask | show | jobs | submit login
Regex Visualization: give it a regex and see the state diagram (strfriend.com)
67 points by jjguy on Jan 22, 2011 | hide | past | favorite | 14 comments



It would be more useful if the state diagram page displayed the original regex.


Two other regex-understanding tools I've found useful:

http://www.regexbuddy.com/

http://www.regexio.com/


My personal favorite:

http://gskinner.com/RegExr/



Unfortunately it doesn't allow me to enter the regular expression found here: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html. It's horrendous I but would love to see it visualized.


I think the ultimate tool for understanding regexps is Russ Cox's notes:

http://swtch.com/~rsc/regexp/

When explained well, the big picture of NFAs and DFAs is bog simple. I'm sure some of the details are messy, but I expect they rarely matter.


Visualization of the perfect email regex: http://goo.gl/p80Ky

Regex source: http://fightingforalostcause.net/misc/2006/compare-email-reg...


Please don't use that to filter real email addresses. The author admitted he doesn't distinguish between addresses which are actually invalid and those he merely doesn't think are advisable to use, and it's not clear whether he even read the RFC 2822 grammar. At a glance, there's only one regex on the page that makes any effort to handle the valid address "Your Name"@example.com.


The re.DEBUG flag for the python re module is also really useful in this regard


This is nice for visualizing an NFA and the minimized DFA for asome regular expression (note: regular!!): http://osteele.com/tools/reanimator/. The aforementioned tool also lets you give input and highlights the current states of each FA.


Kept giving me errors about unbalanced brackets, but the same regexps work perfectly as patterns in BBEdit (PCRE) and in Ruby (Onig).


This is really helpful. I always struggle with regex expressions when they reach some complexity.


awesome. the best would be if you could go in the opposite direction. like if you could create regular expressions in the image view and have it output the text version.

this would probably help a lot of people who aren't 'ninjas' like you and me ;?j


Was the visualisation done with a free library? Anyone know the name of it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: