Earlier quoted context omitted.
This is a good point. Also mentioning which flavour of regexp is supported would be nice.
The input bar says Javascript style before you start typing something in..
Regexper: Beautiful regexp visualizations
91–100 of 132 posts
Re: Regexper: Beautiful regexp visualizations
#92it 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.
I mean, obviously unless you are writing an MTA or whatever.
Re: Regexper: Beautiful regexp visualizations
#93Earlier quoted context omitted.
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.
I agree that the value derived from email validation for something like a new account registration is almost nil. Just do something like an email verification round trip, which not only validates the email could be real, but also provides assurance that the user has control of the email address used.
Note: My last name is O'Kelley, which is a bit of a pain when it comes to poorly designed computer services. Some sites will strip the ' and others will escape it so that I become Mr. O\'Kelley. The worst I've seen is that my school used my complete last name in my email address, so most sign up forms refuse to even try to accept it, even though it is a valid email address. It can be a pain if I need to use my .edu address for academic discounts or verification.
Re: Regexper: Beautiful regexp visualizations
#94Earlier quoted context omitted.
No, it's called a finite state machine ;)
The FSM is the model, the Railroad Diagram is the view, to borrow terms.
Re: Regexper: Beautiful regexp visualizations
#95Hello, 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).
Re: Regexper: Beautiful regexp visualizations
#96but it doesn't show what is matched - as in a example matched string - which is the most important thing also how do you put in the case insensitive flag?
I think this would be quite valuable -- provide a second input for sample text and highlight the path taken. Bonus points for figuring out a way to handle multiple sample inputs, showing capturing group output, etc.
Re: Regexper: Beautiful regexp visualizations
#97Hello, 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).
Re: Regexper: Beautiful regexp visualizations
#98it 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]+(?:(?:…
Use something like `^([^\s]*)@([^\s]*\.[^\s]*)$` which will do most of the work for you, then check second group for common domain typos, and what have you.
Re: Regexper: Beautiful regexp visualizations
#99Earlier quoted context omitted.
The FSM is the model, the Railroad Diagram is the view, to borrow terms.
Well, as long as we're picking nits, an FSM accepts only regular languages, while a rail road diagram accepts context-free languages[1]. So a railroad diagram isn't really the "view" for an FSM. A state-diagram or state-transition table is (although the whole MVC analogy is itself kind of weird. Where's the controller?). [1] http://en.wikipedia.org/wiki/Syntax_diagram
The MV* family of patterns seems to be okay without the notion of a controller.
Re: Regexper: Beautiful regexp visualizations
#100Hello, 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).
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).