On 12 Jun 2001 10:24:23 -0500, [EMAIL PROTECTED] wrote:
> > print "You're cheating!" if($add_alias =~ /[^\w\.\-]/g); # \w Match a
> > "word" character (alphanumeric plus "_")
> >
>
> wow. thanks. that looks just like what i need. however, i also
> want to match the _ character as well. so will
>
> /[^\w\.\-\_]/
>
> work for me?
>
> thanks!
\w includes _. The \w character set is anything that can be included
in a variable name. On the topic of shortening the regexp: "." in a
character class does not need to be escaped so you can write it like
this
print "You're cheating!" if($add_alias =~ /[^\w.\-]/);
--
Today is Pungenday, the 17th day of Confusion in the YOLD 3167
Umlaut Zebra über alles!