in reply to Simple Regular Expression Help Needed
will do ya.my @localfiles=grep/^file-15a_62_200405.*\.txt$/i readdir LOCALDIR;
In this case the simplest thing is to write a regexp that includes both requirements. You do this by separating the conditions at both ends with an "anything goes" linker; that's what the .* bit is all about. Also note that parentheses are not needed in this case.
Sometimes it happens that it is simplest to use two or more separate regexp tests, which can still be combined in a single grep, like this:
my @localfiles=grep /^file-15a_62_200405/i && /\.txt$/i readdir LOCALD +IR;
For a tutorial try perlretut.
Update:Added explanatory remarks.
the lowliest monk
|
|---|