Link to home
Start Free TrialLog in
Avatar of kruegerste
kruegersteFlag for United States of America

asked on

Regular Expression - Allow White Spaces

I have an asp.net control using a regular expression for validation, it is for an email address.  It allows alphanumeric and also allows 1 character domain names.  

I need to modify it to also allow white spaces at the beginning and end of it (but not anywhere in the middle).  Not sure how to do this, I have tried and have failed miserably thus far.  

Here is the current expression which works as desired but new request for white spaces means it needs to be updated:

Public Const REG_EMAIL As String = "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"

Thanks in advance, I hope someone can help.

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kruegerste

ASKER

Awesome, thanks. Works perfect.  
Awesome, thanks. Works perfect.  
NP. Glad to help :)