in reply to Regular expressions

Alternately, you can make sure that it doesn't contain characters that aren't the class.
if ( $temp2 =~ /[^a-zA-Z]/ ) { die "Wrong input"; } else { # Do something useful }

This is a very strong way to work. You're whitelisting and not blacklisting, which is best.

Replies are listed 'Best First'.
Re^2: Regular expressions
by DDH (Initiate) on Apr 13, 2005 at 14:08 UTC
    Thanks for the information