in reply to Using grep to find "/<file system"
You need to put the negation operator outside of the regex; otherwise, you're telling Perl to look for a literal '!'...
my @files = qw (/usr /home /sbin /opt/...); my @filtered = grep !/^(\/usr|\/sbin|\/platform|\/lib)$/, @files; print "@filtered\n"; # /home /opt/...
|
|---|