in reply to read the whole folder files
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read the whole folder files
by Marshall (Canon) on Apr 09, 2012 at 23:18 UTC |