[svn:perlfaq] r8076 - perlfaq/trunk
[email protected] Wed, 15 Nov 2006 05:53:24 -0800 (PST)
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
Author: rafael
Date: Wed Nov 15 05:53:23 2006
New Revision: 8076
Modified:
perlfaq/trunk/perlfaq9.pod
Log:
* perlfaq9.pod: as discussed on P5P, it's better to spell out the contents
of \w in the regexp to validate email addresses, in case of locales
jumping in. Also, quote $ properly in qr{}, and add the valid | character
(according to RFC 2822)
Modified: perlfaq/trunk/perlfaq9.pod
==============================================================================
--- perlfaq/trunk/perlfaq9.pod (original)
+++ perlfaq/trunk/perlfaq9.pod Wed Nov 15 05:53:23 2006
@@ -429,8 +429,7 @@
folding whitespace, or any other obsolete or non-essential elements.
This I<just> matches the address itself:
-
- my $atom = qr{[\w!\#$\%&'*+/=?\^`{}~\-]+};
+ my $atom = qr{[a-zA-Z0-9_!#\$\%&'*+/=?\^`{}~|\-]+};
my $dot_atom = qr{$atom(?:\.$atom)*};
my $quoted = qr{"(?:\\[^\r\n]|[^\\"])*"};
my $local = qr{(?:$dot_atom|$quoted)};