|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Tue Jun 27, 2006 2:44 am
regex question |
i'm starting to delve into regex, i was wondering about this pattern i'm working on. i have a pattern that can either look like:
Time : 3 mins 21 secs
Time : 1 hr 3 mins 21 secs
Time : 2 hrs mins 21 secs
Time : 1 day 1 hr 3 mins 21 secs
and so on, i'm wondering how to condense this into a single regex expression, i've tried:
Pstat Time \: (?phours:.+) (hr:.*) (?pmins:.+) mins (?psecs:.+) secs |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Jun 27, 2006 9:00 am |
^Time \:(?: \d+ day(?:s|))(?: \d+ hr(?:s|))(?: \d+ min(?:s|))(?: \d+ sec(?:s|))
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|