in reply to Regex Problem
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex Problem
by grinder (Bishop) on Aug 01, 2007 at 18:02 UTC | |
by FunkyMonk (Bishop) on Aug 01, 2007 at 18:14 UTC |