At 02:17 PM 6/13/01 -0700, Peter Cornelius wrote:
>I've never used Email::Valid but it may be a good way to solve the problem,
>I'd be impressed if it actually catches all valid addresses (and very
>happy). I've always just accepted that there would be some special cases
>that wouldn't be caught
> Subject: testing on email characters
I just wanted to expand on Jeff Yoaks comment that the regexes discussed in
this thread don't actually validate syntax on _all_ e-mail addresses. I
think this is a common problem. I remember looking this up in 'Mastering
Regular Expressio
o point
out here is that these expressions have nothing to do with "testing on
email characters." They will pass things that aren't valid email addresses
and they reject many things that are. The Internet is full of people doing
things like this:
if ($email =~ /[\w\.-]+\@[\w\.-
/^[\w.-]+$/ and !/[^\w.-]/ have one major difference (and I am kicking
myself for not seeing it until now). The former requires that at least
one character must exist. !/[^\w.-]/ is equivalent to /[^[\w.-]*$/.
However, this can be overcome by saying !(/^$/ or /[^\w.-]/) and it
still has one ad
On Tue, Jun 12, 2001 at 02:19:23PM -0400, Chas Owens wrote:
> /[\W.-]/ expands to /[[^a-zA-Z0-9_].-]/
Conceptually, yes, but the pattern /[[^a-zA-Z0-9_].-]/ isn't going to give
you what you seem to expect if you were to actually try to use it. \w, \W,
\d, \D, and friends are magic like that; the
On 12 Jun 2001 18:45:23 +0200, Jos Boumans wrote:
> Please, if you try and flame posts, get your facts straight.
>
> 1st: - is a range operator, and hence needs not be escaped when it's not
> indicating a range, ie, at the beginning or end of a []
> so this regex is not 'wrong'. fee
Please, if you try and flame posts, get your facts straight.
1st: - is a range operator, and hence needs not be escaped when it's not
indicating a range, ie, at the beginning or end of a []
so this regex is not 'wrong'. feel free to try it.
2nd:the regex is purposely written ver
On 12 Jun 2001 17:45:16 +0200, Jos Boumans wrote:
> try this:
>
> unless (/^[-\.\w]+$/) { print "you cheater!" }
>
> this will check if from beginning to end of $_ it contains - . (not even sure
> you need to \ the . ) or any word character (a-z A-Z and _ )
>
> the ^ says to start at the beginn
try this:
unless (/^[-\.\w]+$/) { print "you cheater!" }
this will check if from beginning to end of $_ it contains - . (not even sure
you need to \ the . ) or any word character (a-z A-Z and _ )
the ^ says to start at the beginning of the string... the $ says to read till
end of line...
i'm o
if ( $add_alias =~ /\@/ ) {
right now i am testing a variable to see if it contains an \@ character. i
would prefer to test it to see if it has anything *other* than
a-zA-Z0-9\.\-\_
can i do this with a regex like
if ( $add_alias =~ /[^a-zA-Z0-9\.\-\_]/ ) {
i am not certain if my sear
10 matches
Mail list logo