Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #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:
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 <>") 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).


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

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (4)
    As of 2018-06-18 03:02 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (107 votes). Check out past polls.