3 ms·
I don't think that's true. In JS: /^[^@\s]+@\S+$/.test("john.\"@\".doe@valid.example") == true Edit: Hmm, I see what you mean. At first glance I thought it
by __ryan__ 4y ago
I don't think that's true.
In JS:
/^[^@\s]+@\S+$/.test("john.\"@\".doe@valid.example") == true
Edit: Hmm, I see what you mean. At first glance I thought it was just checking that it didn't start with @ or whitespace.
- papercrane 4y agoSorry, I edited my comment and then noticed you replied already. It's working by accident since the '\S+' will match the second '@', but if you had a quoted space in the user it would not work e.g. john."\ ".doe@valid.example, but would work with john.@.doe@invalid.example which I believe the regex is author meant to be caught as invalid.