Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Please guys, let me make some statements here, since I was apparently misunderstood:

I've understood Ovid's post, davido and really appreciated his contribution (as usual), but I'd like to *learn* to build a regex for that matter.

Just because a "standard" way of building it exists it's not unmutable, e.g.:

Ovid first allows a whitespace and/or tab to be in the beginning of the e-mail address:
[\040\t]*
I wouldn't do that. *My* line of thinking and the logic that reigns on the app I'm coding is: if the user has entered a whitespace in the beginning of the webform field, well, too bad for him. Even better, I'd write a JS function to disable whitespaces on that field. Since it's a web app it's better for me (and most probably for the user) to do it this way.

The *only thing* I want to do is to validate an e-mail address (not something like "My name <myemail@myserver.com>") using a regex built by *me*. I want to learn that. I don't care if there is a module that already has this implemented. I don't care if there is a "generally accepted" way of doing it. I want to do it myself because I want to understand the full concept of it and then learn from it.

All I've wanted was some advices and tips on how to do it and some critcics on my regex.

So far in this node, only Ovid provided me that (with the link to the RFC and the addresses examples fom Mastering Regular Expressions).

Cheers,


In reply to Re: Please evaluate: RegEx for validating e-mail addresses by DaWolf
in thread Please evaluate: RegEx for validating e-mail addresses by DaWolf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-23 08:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found