[EMAIL PROTECTED] wrote on 09/11/2007 04:48:20 PM:

> Stuart Guthrie wrote:
> 
> > Not being a regex expert I was hoping someone could point me at a
> > list, forum or just give me a pointer on how to achieve this:
> > 
> > Field that must have 2 out of 3 of these:
> > 
> > standard a-z/A-Z
> > arabic numbers 0-9
> > special chars %$#@
> 
> [EMAIL PROTECTED]|[A-Za-z0-9]+|[EMAIL PROTECTED]
> 
Since I don't have a better answer, I should probably keep quiet, but 
there is a flaw in your regex:
[EMAIL PROTECTED]:~$ perl
my $var = 'a';
if ($var =~ /[EMAIL PROTECTED]|[A-Za-z0-9]+|[EMAIL PROTECTED]/) {
print "True\n";
}
^D
True

$var doesn't match the required 2 out of 3 characters, but still matches.

Cheers,

Scott
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to