4 ms·
Neither beautiful nor a visualization really. For the uninitiated, there's an isomorphic relationship between regular expressions (not PCREs which are way more
by knowtheory 14y ago
Neither beautiful nor a visualization really.
For the uninitiated, there's an isomorphic relationship between regular expressions (not PCREs which are way more complicated) and finite state automata proving that if you have a regexp you can generate a FSA for it, and visa versa.
What we have here is a system that generates a graph of the finite state automaton for any given regular expression.
Neat project, misleading headline.
edit: let me add more constructive comments. What is useful about things like rubular (http://rubular.com/ http://rubular.com/ ) is the ability to see how a Regexp behaves with a given input. Where a finite state chart can be useful is giving users a better impression of the internal workings of a particular regular expression. Where rubular can indicate where a match can be found, it would be cool to have a tool like this if you can show the path a particular input would take (and possibly fail out on) through a given regular expression.
- AUmrysh 14y agoThe path idea is a great one! If the original dev doesn't add that I may be tempted to try building my own regex tool with these features.
- ricardobeat 14y agoI disagree. It could look better, but I fail to see how a graph is not a visualization (?) Quite useful to show junior devs who are usually afraid of RegExp. Example from jQuery/Sizzle's: http://cl.ly/image/321F0E2B222o http://cl.ly/image/321F0E2B222o (^ and $ removed since it's failing to parse)
- hockeybias 14y agoHuh. I wonder if it could handle ^Snarky\s(ass)?\s(Know\sIt\sall)?comment
- TallboyOne 14y agoSorry, but how is that not a visualization? If you're learning regular expressions that's about the best thing you could possibly 'see', even though it doesn't show matches for specific input. And I do actually think it's beautiful. I pasted in a huge regex and was delighted at the output.
- RegEx 14y agoThis type of useless comment is why I tend to avoid HN for periods at a time. Congrats, you've shown the world you know what "isomorphic" and "FSA" means, but did you initially bring anything constructive? No. You had to edit in things barely constructive because your impulse was to tear down rather than build up. > Neither beautiful nor a visualization really. This is the least helpful thing I can imagine. "Here's a beautiful regex visualizier" "LOL NO IT'S NOT". Geez.
- tripzilch 14y ago> This type of useless comment is why I tend to avoid HN for periods at a time. There's useless pedants like this all over the Internet. You should probably wear a hat. I'd agree if this were the top two comments without many disagreeing replies or down-votes. I see this comment in down-voted grey, somewhere way down the page and assume a lack of social skills, bad-morning-before-coffee-grumps. Or simply Internet Asshat Background Radiation, it's everywhere. Legends say you can trace its echos back to the First Flame from which the Internet was born.
- RegEx 14y agoIt wasn't grey when I commented. I wouldn't take the time to get on a soapbox if the community had already buried it.
- cmain 14y agoFor those interested in this, look up Thompson's Algorithm (http://en.wikipedia.org/w/index.php?title=Thompson%27s_construction_algorithm&oldid=515598638 http://en.wikipedia.org/w/index.php?title=Thompson%27s_const...).