3 ms·
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-(ty
by porridgeraisin 1y ago
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) 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.
- drowsspa 1y agoYeah, for all intents and purposes that's the spec for emails now
- littlestymaar 1y agoTIL thanks.