write the regular expression for date format of mm/dd/yy?

Answers were Sorted based on User's Feedback



write the regular expression for date format of mm/dd/yy?..

Answer / rajesh

[1-9]|1[0-2]/[1-9]|[1-2][0-9]|3[0-1]/19[0-9][0-9]|2[0-9][0-9][0-9]

More food for thought valid from 1900 to 2999.

Is This Answer Correct ?    13 Yes 0 No

write the regular expression for date format of mm/dd/yy?..

Answer / rajesh

Pavani your point is correct

Here is the format for the input.
MM will be 1 to 12 "[1-9]|1[0-2]"
DD will be 1 to 31 "[1-9]|[1-2][0-9]|3[0-1]"
YY will be "[0-9][0-9]"

Hence MM/DD/YYYY will be
"[1-9]|1[0-2]/[1-9]|[1-2][0-9]|3[0-1]/[0-9][0-9]"

Is This Answer Correct ?    10 Yes 5 No

write the regular expression for date format of mm/dd/yy?..

Answer / hetal

Regular experession can also be written in qtp as follow:
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d

Is This Answer Correct ?    2 Yes 0 No

write the regular expression for date format of mm/dd/yy?..

Answer / falak

^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$

Is This Answer Correct ?    3 Yes 2 No

write the regular expression for date format of mm/dd/yy?..

Answer / pratap

[0-1][0-9]/[0-3][0-9]/[0-2][0-9][0-9][0-9]

Is This Answer Correct ?    3 Yes 3 No

write the regular expression for date format of mm/dd/yy?..

Answer / lak

^([1-9]|0[1-9]|1[0-2])[- / .]([1-9]|0[1-9]|1[0-9]|2[0-9]|3
[0-1])[- / .](1[9][0-9][0-9]|2[0][0-9][0-9])$

Is This Answer Correct ?    0 Yes 0 No

write the regular expression for date format of mm/dd/yy?..

Answer / sai shankar

(0[1-9]|1[0-2])[./-](0[1-9]|1[0-9]|2[0-9]|[a-z])[./-]([0-9]{4})

Is This Answer Correct ?    0 Yes 0 No

write the regular expression for date format of mm/dd/yy?..

Answer / pavani prasad

Thanks ranu & pratap.

But given regular expressions are accepting the invalid
date like 19/39/2000

Is This Answer Correct ?    0 Yes 2 No

write the regular expression for date format of mm/dd/yy?..

Answer / pavani prasad

Thanks Rajesh

Is This Answer Correct ?    1 Yes 3 No

write the regular expression for date format of mm/dd/yy?..

Answer / ranu rathore

[0-1][0-2]/[0-3][0-9]/[0-2][0-9][0-9][0-9]

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More QTP Interview Questions

what r the 3 basic factor on which we determine to perform automation

6 Answers   AppLabs,


Explain object spy in qtp.

0 Answers  


where do you define the objects as regular expression when u are using regular expressions.

4 Answers  


How you test the object which is dynamically changes its location?

7 Answers   Wipro,


without Qtp features can we automated?

1 Answers   IBM,






what are the different Frame Works in Quick Test Proffessional testing

3 Answers   Wipro,


Can a function return a dictionary object?

2 Answers   CG, Semantic Space,


What is quick test pro? What is a quick test professional?

0 Answers  


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

0 Answers  


What is Data driven Testing Frame work.Anybody can expain it in Detail.. Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


How can i check all the button that are enabled in a widnows based application ? What script should i write for this ?

1 Answers  


now a days which one is using all companies for qtpscript a)Object Repository based script b)Descriptive program based script c)BOTH

1 Answers  


Categories