slightlyoff
asked on
Regular Expression - allow emails with period in the name.
I had ran into an issue previously where my regex expression wasn't allowing periods in the name for emails. for example, my.email@gmail.com wouldn't work. Thanks to the fine experts at Experts-Exchange, that is working now.
However, email addresses like my.email75@gmail.com or myemail.11@gmail.com don't work. Here's my expression & the function i'm using:
To me it looks like it's allowing numbers - so I'm not sure what needs to be changed. Any suggestions?
However, email addresses like my.email75@gmail.com or myemail.11@gmail.com don't work. Here's my expression & the function i'm using:
function regIsEmail(fData){
var reg = new RegExp("^[0-9a-zA-Z\_]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$");
return reg.test(fData);
}
To me it looks like it's allowing numbers - so I'm not sure what needs to be changed. Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for your help! that worked great!
ASKER
Thank you Lee - I did go there, but finding an expression that had all the components was difficult. now that people can make email addresses like my_name.75@gmail.co.uk it's getting kind of crazy out there...
http://www.regexlib.com/RETester.aspx?regexp_id=26