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/...
In reply to Re: Using grep to find "/<file system"
by Eliya
in thread Using grep to find "/<file system"
by boneman147
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |