Regular Expression

Posted by Sibin.rhythm under ASP.NET on 9/22/2009 | Views : 991 | Status : [Member] | Replies : 2
I need a regular expression which satisfy the condition 01:00 am

satisfy --> 01:00 pm,12:30 pm, 09:05 am
dont satisfy --> 1:00 am, 2:5 pm ,02:5 pm

the condition must follow 12 hr format., if any values like 13:00 pm ,20:30 pm never satisfy....

Please help me...

Thanks in Advance....




Responses

Posted by: Rtpharry on: 9/23/2009 [Member] [MVP] Bronze

Up
0
Down
Hey,

I checked on Regexlib.com for you and it seems this one will satisfy your requirements:

http://www.regexlib.com/REDetails.aspx?regexp_id=144

That regex will allow : or . separators which if you dont want then you just need to go through the regex and find all the (:|\.) and replace it with :

Sibin.rhythm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RtpHarry on: 9/28/2009 [Member] [MVP] Bronze

Up
0
Down
Hmm seems like my post was hit by a bug on this forum... here is the link again because I was told it has been fixed today:

http://www.regexlib.com/REDetails.aspx?regexp_id=144

Sibin.rhythm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response