Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And what kind of form validation are you going to do with a regular expression? E-mail addresses like every other fool? (This is a the best to reject perfectly valid addresses because you baked unjustified assumptions in you regex)


For what it's worth, the inbuilt HTML5 validation that implementw input type=email does have a regex in the spec.

https://html.spec.whatwg.org/#email-state-(type=email)

  /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

But it is true that you can implement it with a FSM(which is what firefox does). Webkit uses a regex as well I think.


Yeah, for all intents and purposes that's the spec for emails now


TIL thanks.


Me? None. I'm not the one proposing the use of Rust and WASM for form validation.

What kind of validation are you going to do without a regular expression?


> What kind of validation are you going to do without a regular expression?

Actual form validation… I can't even think of a single kind of form validation where a regex would help…


The bigger and more complex the application, the less is the effect of this.




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

Search: