more useful options | |
PerlMonks |
Re: read the whole folder filesby halfcountplus (Hermit) |
on Apr 09, 2012 at 20:23 UTC ( [id://964199]=note: print w/replies, xml ) | Need Help?? |
in the grep, you have a regex, with a rather strange looking pattern.
Ditto. Maybe you've confused shell globbing with regular expressions? Let's break this is down: _*_.txt"_*_" would mean, zero or more instances of "_", with a "_" following. Then "." matches any character. If you want to match _one_.txt, _two_.txt, etc, you should use: _.+?_\.txtWhich means: a "_" followed by one or more of anything, non-greedily (because + is followed by ?, but note ? has another meaning in regexps depending on context; non-greedy matching is important when you are looking for any number of anything, followed by something in particular), then "_." (notice the . is escaped with \ because . alone has a special meaning, see above) followed by "txt". If you haven't yet: perlretut.
In Section
Seekers of Perl Wisdom
|
|