|
|
|
|
|
by coolhoody
1514 days ago
|
|
This won't be popular, but: 1. An experienced dev just killed 54k stars on GitHub due to pressing a button in an auto-pilot mode. Do you think a Joe High who wants to give you $100 won't ever type '2' instead of '@'? What about an old lady? Or someone with physical difficulties? Have you personally ever made a typo in an email? 2. That code in the article is not color highlighted (rainbowed for Regex) or formatted properly. If I write something in any language in one line without highlighting — it'd look unreadable as well. 3. A Regex for this specific purpose is write-once-and-forget. You won't need to edit it for 20 years. 4. Regex — for practical tasks — is way easier than it's being painted. Not easy — just not as hard as some suggest. 5. I'm not a Regex fanboy (nobody is). |
|
I do like to check for '@' to enure the user have not entered their name or something by mistake, but beyond that the syntactic validation does not provide any value.