merlyn says please stop encouraging DaWolf - he's heading down a dangerous path
It's true that you're heading down a dangerous path. Whatever regex you finally come up with, please don't use it in a production application. Use Email::Valid on the server and don't try to do complex processing in JavaScript.
What is the application you want to validate e-mail addresses for? Do you only care that they're syntactically valid or do you want to verify that there's a real person on the other end? In the second case you'll need to do more than just run the address through Email::Valid.
For educational purposes only, I'll point out that your regex rejects 'er_galvao_abbott@somedomain.com' and accepts 'er...galvao...abbott-_-_-_@somedomain.com'. Is that what you want?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|