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}))$
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
This regex will cover single letter domains.
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
精彩评论