in reply to regexp to check if file name matches pattern
Perhaps this:
/^SYS(?:[^%]+%)+[^.]*\.pdf/i
Matches SYS followed by any non % character(s) that are followed by a % (can be repeated), followed by just about anything except a dot (.) (that's where the date field goes), followed by dot pdf.
Update: /i added, because when I see SYS and .pdf (upper, and lower) I start thinking that case probably shouldn't be allowed to foul up a match.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regexp to check if file name matches pattern
by smanicka (Scribe) on Feb 24, 2009 at 22:11 UTC | |
by davido (Cardinal) on Feb 24, 2009 at 22:15 UTC |