We are using regex
to validate Emails. But it seems like it is failing for abcd@q.com this Email ID.
Can anyone please advise what is wrong in the given regex?
Regular Expression:
string sPattern = "^\\w+[\\w\\-\\.]*\\w+\\@\\w+([\\w\\-]*\\w+\\.\\w+){1,4}$";
Edit: what can I modify in the given regex so that it should accept both single character and multiple character domain after @
.
Ex: abcd@q.com or abcd@example.com