The quotes inside the regex seem to be a problem, since there are no such quotes in the command.
$ perl -wE '"sort by CPU" =~ m/sort\s+by\s+(CPU|USER|PID)/ and say $1' CPU
Works just fine.
In reply to Re: regex issue
by moritz
in thread regex issue
by perlNewby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |