How do u write a regular expression for date (dd/mm/yyyy)
field?

Answers were Sorted based on User's Feedback



How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / amarendra kothuru

The above regular expression(Ans:1) will fail as it allows
day between 31 to 40 as well.

The following regular expression takes care of all cases
and validate the format (dd/mm/yyyy)

(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/\d{4}

Is This Answer Correct ?    22 Yes 15 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / kirti

(0[1-9]|[12][0-9]|3[01])[//](0[1-9]|1[012])[//]([0-9]{4})

Is This Answer Correct ?    7 Yes 5 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / krishna

This is the corect answer:

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

[0-9]{4}

Is This Answer Correct ?    6 Yes 4 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / satish yadav

To write regular expression for dd/mm/yyyy format
[0-3][0-9][/](([0][0-9])|([1][0-2]))[/][0-9]{4}

Is This Answer Correct ?    20 Yes 20 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / naresh

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


Tjis is the perfedct regular expression for the date.. guys...

Is This Answer Correct ?    0 Yes 0 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / megh

Regex Birthdate = new Regex(@"((0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))[-/]{1}((0[0-9]{1})|(1[0-2]{1}))[-/]{1}[0-9]{4}");

Is This Answer Correct ?    0 Yes 0 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / laxman

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

Is This Answer Correct ?    0 Yes 0 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / gopal

Experts,

I want expression for DD.MM.YYYY !!

Please help !!

Thanks a lot !!

Is This Answer Correct ?    0 Yes 1 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / megh

Regex Birthdate = new Regex(@"((0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))[-/]{1}((0[0-9]{1})|(1[0-2]{1}))[-/]{1}[0-9]{4}");

Is This Answer Correct ?    0 Yes 1 No

How do u write a regular expression for date (dd/mm/yyyy) field?..

Answer / sk

[0-9]+//[0-9]+//[0-9]+
use this buddy...

Is This Answer Correct ?    6 Yes 9 No

Post New Answer

More QTP Interview Questions

How will you handle the situation when object is not captured during record?

12 Answers   AZTEC,


What is the dis advantage of check points in QTP, if any?

6 Answers   BirlaSoft,


Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....

0 Answers  


what is Compile Module in QTP? what exactly it contains Functions or Actions?

2 Answers   GE,


How QTP recognizes Objects in AUT?

8 Answers   Blue Star,






How to enter table check points?

2 Answers  


How to find the name of the machine where you are running your automation scripts in qtp?

0 Answers  


Hi guys, Please suggest some thing these points are correct???, Is UFT 12 and QTP outdated ??? and also VBscript is also deleted/Removed from QTP ???? Javascript is added latest and tool name is called JFT ??? From this year ??

2 Answers  


How to write test cases for web applications using QTP.plz write a sample test case to show how to write.urgently needed.thanks in advance..

4 Answers   IBM,


If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened. What would be Descriptive programming for this in QTP using VB Script..??? Please send your answers.

6 Answers  


How would you parameterize the text field "Country" and the same "country" when it appears as combo field on other page with text field city and same with City combo field?

1 Answers   Adobe, Patni,


I have java based application on my computer. Can I install QTP on it? What are system requirements for installing QTP?

3 Answers  


Categories