List, What if $string does not meet the criteria in s/[^a-zA-Z0-9]+//g; can I get a print statement to say...
if ($string ne s/[^a-zA-Z0-9]+//g) { print "$string does not meet our criteria...! Please try another password\n"; } Is this OK.... Dan -----Original Message----- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Thursday, 6 December 2001 2:48 PM To: Daniel Falkenberg Cc: [EMAIL PROTECTED] Subject: Re: Confirmation... On Dec 6, Daniel Falkenberg said: >$string =~ s/[^a-zA-Z0-9]//g; > >I take it only allows $string to eq anthing in the charcter class of >a-z, A-Z and 0-9. I also take it that anything other than that will be >stripped out? Any other comments? Right. I'd write it as s/[^a-zA-Z0-9]+//g; for "efficiency". Or perhaps as tr/a-zA-Z0-9//cd; for "clarity". Your ideas of "efficiency" and "clarity" may differ. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]