http://www.perlmonks.org?node_id=500315


in reply to Perl Regexp help w/ grep

Greetings all,
Here is my suggestion.
#the following is untested. my @local_files = grep /^$id.*?_arbv_/i, readdir LOCALDIR;
The . matches any character. The * matches the previous character 0 or more times and the ? keeps it from being too greedy (well in concert with * that is) So it matches the shortest amount possible not the longest.

-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo