Reputation: 28820
I have the following email regex which I got from stackoverflow:
/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()\.,;\s@\"]+\.{0,1})+[^<>()\.,;:\s@\"]{2,})$/
We want to fail all email addresses that are of this form:
How could I update the regex to cover this case?
Upvotes: 0
Views: 40
Reputation: 1
You can check if the beginning of the string are digit characters followed by "@"
character
// returns `false` if match is found
!/^\d+(?=@)/.test("[email protected]") && /* other `RegExp`s */
Upvotes: 2