Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: @ in regex, or not?

by Clownburner (Monk)
on Mar 26, 2001 at 21:57 UTC ( [id://67264]=note: print w/replies, xml ) Need Help??


in reply to @ in regex, or not?

This is a lot harder than it looks, if you have to pass every possible RFC-valid Email address. The Mastering Regular Expressions book has the most complete example I know of, but it's a little over 5k in size.

One thing to consider here is what your target audience is likely to enter as an email address, and think about how precise to need to be. If it's an intranet application and everyone's email addresses are in a simple format (foo@barr.com) then a simple Regexp is likely the trick, but if you may need to support international and unusual (UUCP gateway, anyone?) email addresses, you might go to something more elaborate, like the MRE method.

You can download the email regexp here: http://public.yahoo.com/~jfriedl/regex/code.html

HTH!
Signature void where prohibited by law.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-24 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found