Live data from Hacker News

Regexper: Beautiful regexp visualizations

regexper.com

81–90 of 132 posts

Re: Regexper: Beautiful regexp visualizations

#81
post #47

Earlier quoted context omitted.

Neat tool, I like how clear the visualizations are. It didn't work for me under Chrome on OSX, though. Chrome Version 23.0.1271.101, OSX 10.7.5.

Works for me, Chrome 25.0.1364.5 dev, OS X 10.8.2. Maybe it's a stable version bug.

Which means you need input from my platform, the third of the three combos: Works for me on Chrome 23.0.1271.101, OS X 10.8.2.

Re: Regexper: Beautiful regexp visualizations

#83
post #7

I tried the most complicated regular expression in the world: http://ex-parrot.com/~pdw/Mail-RFC822-Address.html and the server 500'd. Just joking, it's a very good tool. P.S. it crashed with three nested groups (((a*)))

As an aside. I quit using regex to validate email addresses a while ago. Part of it is that a regex that large is simply incomprehensible and very difficult to maintain and fix if something is broken. The best solution, in my opinion, is a state machine based analyzer that checks the email address character-by-character and confirms compliance with RFC5322. This would also include checking DNS for MX records (which m…

No, stop validating emails. Not only it's error prone and will frustrate legit users but it utterly pointless.

Re: Regexper: Beautiful regexp visualizations

#84
post #57

Earlier quoted context omitted.

You should build a tool that is the inverse of this. Let people build regular expressions by creating the visual diagram (some sort of click and drag GUI).

I've always wondered why there doesn't already exist such a tool. Regex strings are so opaque and hard to read. We can't really fix that for code (short of building objects), but what we could fix is a better way to write them. A graphical tool to create them, built of units instead of just strings, and the output could still be a regex string.

KDE 3 had KRegExpEditor (http://www.blackie.dk/KDE/KRegExpEditor/) but it only recently found someone interested in porting it to KDE 4.

Re: Regexper: Beautiful regexp visualizations

#85
post #73

it breaks with this: (?:(?:\r\n)?[ \t]) (?:(?:(?:[^() @,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] )+|\Z|(?=[\["() @,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t])) "(?:(?: \r\n)?[ \t]) )(?:\.(?:(?:\r\n)?[ \t]) (?:[^() @,;:\\".\[\] \000-\031]+(?:(?:( ?:\r\n)?[ \t])+|\Z|(?=[\["() @,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t])) "(?:(?:\r\n)?[ \t]) )) @(?:(?:\r\n)?[ \t]) (?:[^() @,;:\\".\[\] \000-\0 31]+(?:(?:…

BTW, using this regex to validate email is a bad idea. For one thing, it doesn't cover RFC5322. The only right way to do it, as far as I am concerned, is state machine code that evaluates the address character by character as well as DNS.

Re: Regexper: Beautiful regexp visualizations

#87
post #47

Hello, I'm the creator of this (trevmex is one of my co-workers). I just want to thank everyone for the feedback so far, I am looking into the issues that have been brought up (they'll have to wait until this evening to be fixed though...I have a day job).

Neat tool, I like how clear the visualizations are. It didn't work for me under Chrome on OSX, though. Chrome Version 23.0.1271.101, OSX 10.7.5.

It works now. Soon after trying this, a few pages were crashing with Chrome, and I restarted it. Chrome was most likely in some error state.

Re: Regexper: Beautiful regexp visualizations

#89

Hello, I'm the creator of this (trevmex is one of my co-workers). I just want to thank everyone for the feedback so far, I am looking into the issues that have been brought up (they'll have to wait until this evening to be fixed though...I have a day job).

Hi, thanks for this useful tool.

A question though: a lot of people seem to encounter issues/50x errors with the server-side calculation of the regexp. Why not have a client-side script to interpret the regexp?

Would save server ressources and wouldn't limit the user to server capacity to interpret more complex regexps.

Re: Regexper: Beautiful regexp visualizations

#90

Nice. I wrote something similar a while back (with the goal to show lint errors): regexp.quaxio.com Note: if you type [b-a], you fail to say it's an invalid range.

one more bug: In JS, /[\12]/ only matches \x0a, however /[\92]/ matches '9' and '2'. regexper doesn't handle this correctly. The spec is a little ambiguious iirc.
Post reply on HN