Reputation: 4224
I have the following regex that only works with two letter domains or more. I need this to work with single letter domains as well. Please suggest changes to the regex below.
^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$
Upvotes: 2
Views: 766
Reputation: 4224
This regex will cover single letter domains.
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Upvotes: 0