Automation Testing, Manual Testing, QTP/UFT 11 , QC/ALM 11 ,SAP TAO, Unix, Selenium, Oracle SQL, Shell Scripting and For Online Trinings to contact me : Cell:+91-8897972059 , Email Id : quicktestprotech@gmail.com

Friday, December 13, 2013

Regular Expression for Date and time in QTP/UFT

Regular Expression for Date and time in QTP/UFT



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:

Max Time: 23:59:59
Min  Time: 00:00:00

Hours: ([0-1][0-9]|2[0-3])

Mins: ([0-5][0-9])

Secs: ([0-5][0-9])

Special Character Explanation
| -- OR
Ex: a|b means a or b

( ) -- Used to group multiple regular expressions
[-] -- To specify a range

Ex: 
a[x-z]=ax, ay , az

[a-c][x-z]=ax,ay,az,bx,by,bz,cx,cy,cz

0 comments:

Post a Comment

Loading...