A
Arin
We've got a email regular expression validator that currently looks
like the following:
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
This is mostly fine, but doesn't allow email addresses with single
quotes or underscores in the first part of the email address (before
the @).
I need to change it to allow ' and _ in the first part. I've found
this regular expression on the 15 Seconds website that allows
underscores, but still doesn't allow for single quotes.
^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$
How do I modify the above regular expression to also allow single
quotes? I'm no regular expression expert at all, in fact I haven't
been able to get my head around why the 2nd expression does allow
underscores when the first doesn't.
Here's a bogus email address you can use to test the above
expressions.
patty_o'(e-mail address removed)
thanks for any help you can provide.
-Arin
like the following:
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
This is mostly fine, but doesn't allow email addresses with single
quotes or underscores in the first part of the email address (before
the @).
I need to change it to allow ' and _ in the first part. I've found
this regular expression on the 15 Seconds website that allows
underscores, but still doesn't allow for single quotes.
^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$
How do I modify the above regular expression to also allow single
quotes? I'm no regular expression expert at all, in fact I haven't
been able to get my head around why the 2nd expression does allow
underscores when the first doesn't.
Here's a bogus email address you can use to test the above
expressions.
patty_o'(e-mail address removed)
thanks for any help you can provide.
-Arin