Can you anyone tell a regular expression to check that a date entered has a valid format of MM/DD/200Y ?
Regular Expression for date
|
01-19-2008, 05:03 PM
(0[1-9]|1[012])[//](0[1-9]|[12][0-9]|3[01])[//]200[0-9]$
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
01-31-2008, 10:14 PM
Hi Ankur,
i am regular user of your blog.I found it very useful.I am learning QTP... Can u please explain this (0[1-9]|1[012]) expression. Thank you..
01-31-2008, 10:48 PM
well...the OP has asked for the format MM/DD/200Y
(0[1-9]|1[012]) --- This covers the MM part of the whole expression. [1-9] means any numeral between 1 and 9. [012] means either 0 or 1 or 2 | separator stands for "OR". So when you group the whole expression it mean either look out for month from 01 to 09 or 10 or 11 or 12 month. So this covers the whole range of months available (from Jan to Dec)
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
|
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
How to click on a date button? | Parthasit033 | 0 | 1,930 |
09-06-2017, 01:49 AM Last Post: Parthasit033 |
|
Need Any digit in xpath path using Regular expression | Priyam | 1 | 3,473 |
10-05-2016, 11:05 AM Last Post: Ankur |
|
Regular expression to read two words in lowercase, uppercase and with and without spa | sarahq49 | 1 | 3,342 |
04-09-2015, 01:56 AM Last Post: sarahq49 |
|
Regular expression and script optimisation | Padmavathy | 1 | 3,798 |
03-30-2015, 11:46 AM Last Post: supputuri |
|
Regular expression in descriptive programming | testernc | 1 | 16,551 |
12-08-2014, 06:38 PM Last Post: anshika.agarwal |
Users browsing this thread: 1 Guest(s)