Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please improve my n00b RegEx
#1
This is in Perl, if that matters.

I have a string, called $base.

I want it to match like so:
gd_00000(five integers)_(14 integers, representing a date/timestamp).txt.gz

For example:

gd_0000012345_20070208092930.txt.gz

I've come up with
$base =~ /^gd_00000[0-9]{5}_[0-9]{14}.txt.gz/

Anything better?

Thanks!

GtDS

Edit: Put in a ".". Or is that "put in a ".."?
Reply


Messages In This Thread
Please improve my n00b RegEx - by Greg the dogsitter - 02-08-2007, 03:31 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)