On Tue, 12 Jun 2001, [EMAIL PROTECTED] <[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?
Yes, it will. Just to note again that the "_" (underscore) is already
included in \w. Repeat, 'alphanumeric plus "_"'. Also, if you put the
"-" (dash) in the last sequence (just before the the closing "]"), you
don't need to escape it. You don't need the escape either for the ".",
it means literal inside character class.
So this one will work equally,
/[^\w.-]/
s::a::n
--
http://www.trabas.com