Live data from Hacker News

Regexper: Beautiful regexp visualizations

regexper.com

1–10 of 132 posts

Re: Regexper: Beautiful regexp visualizations

#2
Pretty! I had wanted to make something like this, but one feature I thought of and you didn't do: For the entered regexp, generate 20 random matches and show them to me.

Use case for this feature: You encounter an undocumented regexp in someone else's code and want get a few quick examples of what it matches.

Re: Regexper: Beautiful regexp visualizations

#3
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/ ) 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.

Re: Regexper: Beautiful regexp visualizations

#4
That's really neat.

My only suggestion is that it would be nice to have each regex diagram be separately addressable, by either putting the regex as a query param and yielding a raw image/svg/whatever, or by using a shortened url like a gist after saving.

Very nice work.

Re: Regexper: Beautiful regexp visualizations

#9
post #2

Pretty! I had wanted to make something like this, but one feature I thought of and you didn't do: For the entered regexp, generate 20 random matches and show them to me. Use case for this feature: You encounter an undocumented regexp in someone else's code and want get a few quick examples of what it matches.

Since I'm usually starting with a bunch of data I want to parse/match/chop, I like going the other way - pasting a couple of lines into Patterns ( http://krillapps.com/patterns/ ) and tweaking my expression until it looks right. This would be a useful addition to help debug in place.
Post reply on HN