Reputation: 6083
There are a lot of question on stack overflow possibly for regular expression for email. I assume I will not get taged as duplicate question...:)
Currently I am using regular expression for email address:
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
This works fine with following: [email protected]
What I want to allowed here user can give space at begining or at ending and possibly both for instance: " [email protected] " I want to pass it by regular expression Currently it's giving Invalid I believe it should be.
What I tried ^[ \t]+|[ \t]+$ + \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
But It's not working I am not more familiar with how to write regular expression. Currently I m trying to learn from Here http://www.regular-expressions.info/examples.html.
Upvotes: 0
Views: 750