Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: 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
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net