Posts: 20
Threads: 6
Joined: Sep 2012
Reputation:
0
09-12-2012, 08:15 AM
Hi, I need help with regular expression again. scenario is to handle dynamic date and time
Ex: 09/11/2012 9:10 AM
Another one is just 2 string
Ex : Grant Approved
Posts: 11
Threads: 0
Joined: Aug 2012
Reputation:
0
09-12-2012, 02:16 PM
Hi Jinnah,
Date Regular Expression:
Format: MM/DD/YYYY
MM: (0[1-9]|1[0-2])
DD: (0[1-9]|1[0-9]|2[0-9]|3[0-1])
YYYY: ([0-9][0-9][0-9][1-9]|[1-9]000|[1-9][1-9]00|[1-9][1-9][1-9]0)
* Assuming that Max year is 9999
Time Regular Expression:
Here Max Time: 23:59:59 and Min Time: 00:00:00
Hours: ([0-1][0-9]|2[0-3])
Mins: ([0-5][0-9])
Secs: ([0-5][0-9])
| Choice between two lines
( ) Used to group multiple regular expressions
[-] To specify a range
Try this it may helpful...
I am not sure about the 2nd thing...
Regards,
Sibi C A
Posts: 20
Threads: 6
Joined: Sep 2012
Reputation:
0
09-12-2012, 09:01 PM
Awesome! What if i need to combine both date and time ? What conjunction should be used? Thank you very much again.
Posts: 11
Threads: 0
Joined: Aug 2012
Reputation:
0
09-13-2012, 11:29 AM
Ex1 : MM/DD/YYYY
Ex2 : Hours:Mins:Secs
Include the regular expressions instead of MM DD YYYY Hours Mins Secs.For Dynamic date use '/' (see Ex1) as conjuction.Like this, you can use conjuction ':' (see Ex2) in dynamic time.
Regards,
Sibi C A
Posts: 20
Threads: 6
Joined: Sep 2012
Reputation:
0
09-14-2012, 02:01 AM
I actually need the whole date and time in one regular expression.
And I still have problem handling a text string like "negligent sale of goods and services"
Thanks for the help
Posts: 20
Threads: 6
Joined: Sep 2012
Reputation:
0
09-25-2012, 10:24 PM
Great! I will try it today. I will let you know.Hope it will work. Thanks buddy