Geeky RegEx question

Greebo

N9017H - C172M (1976)
Joined
Feb 11, 2005
Messages
10,976
Location
Baltimore, MD
Display Name

Display name:
Retired Evil Overlord
Geek question!!!

There has to be a better way of doing this:
^bill_file_prc1[0-9]{14}\.pgp$|^bill_file_prx[0-9]{14}\.pgp$|^bill_file_prf[0-9]{14}\.pgp$

I have 3 files I need to look for:
bill_file_prc1MMDDYYYYHHMMSS.pgp
bill_file_prfMMDDYYYYHHMMSS.pgp
bill_file_prxMMDDYYYYHHMMSS.pgp
where MMDDYYYYHHMMSS is a datetime string

Will

^bill_file_(prc1|prf|prx)[0-9]{14}\.pgp$

work instead?
 
Chuck, you don't want my help. :dunno:
Hell, I couldn't even figure out how to put quotes in blue without help.:D
Good luck with your request as I'm lost as last years easter egg.
 
Greebo said:
Geek question!!!

There has to be a better way of doing this:
^bill_file_prc1[0-9]{14}\.pgp$|^bill_file_prx[0-9]{14}\.pgp$|^bill_file_prf[0-9]{14}\.pgp$

I have 3 files I need to look for:
bill_file_prc1MMDDYYYYHHMMSS.pgp
bill_file_prfMMDDYYYYHHMMSS.pgp
bill_file_prxMMDDYYYYHHMMSS.pgp
where MMDDYYYYHHMMSS is a datetime string

Will

^bill_file_(prc1|prf|prx)[0-9]{14}\.pgp$

work instead?

Are there other files you need to exclude that are named similarly?

If not, something like ^bill_file_pr\S*$ will work.

Here's an easy way to check: http://www.fileformat.info/tool/regex.htm
 
Last edited:
Troy Whistman said:
Are there other files you need to exclude that are named similarly?
Yes - thanks for the link! :)
 
Your string looks good to me. Too bad they have that 1 in there. Can't make it easy, huh?
 
Back
Top