![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
regexp to check if file name matches patternby smanicka (Scribe) |
on Feb 24, 2009 at 21:49 UTC ( [id://746115]=perlquestion: print w/replies, xml ) | Need Help?? |
smanicka has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,I have a file names of the pattern SYSBLAHBLAH%BLAHBLAH%BLAHBLAH%timedate.pdf
Could anyone help me write a regexp to check if a given filename matches this pattern? I figure i have to say =~/^SYS something /i but i am not sure how exactly to match up with the first 2 percentage signs, the time date stamp is not of concern.Any help would be appreciated.i need to do : if filename matches pattern, do action .else skip i am attempting the regex as =~m/^SYS\w%\w%\w.*/iWould this work? Thanks - Sandhya
Back to
Seekers of Perl Wisdom
|
|