a four letter word starting with M
In that case, you should also be using the carat to tell your regex that the letter "M" is found just after the beginning of the filename.
m/^M[A-Z]{3}/
So you get:
perl -le'foreach ( <*.txt> ) { print if /^M[A-Z]{3}/ }'
--
Allolex
In reply to Re: One-liner for Matching a Regex in a Directory of Files
by allolex
in thread One-liner for Matching a Regex in a Directory of Files
by svsingh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |