You can use a negated character class: [^-\w] (match any character that isn't a \w or dash):
if ( $dir =~ /[^-\w]/ ) { print "\t$dir is not clean.\n"; } else { print "\t$dir is clean.\n"; }#close if
See perlretut, perlrequick and perlre for the details.
In reply to Re: Regex Problem
by FunkyMonk
in thread Regex Problem
by nimdokk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |