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

Write a command for setvalue function in a webedit

3 Answers   Wipro,


What are the recording modes in qtp?

0 Answers  


I want to learn Advanced QTP, suggest me the best faculty in Hyderabad

12 Answers  


When there is descriptive programming, why do we go for Object repository for desigining scripts.?? why cant we use descriptive programming instead of using the Object repository..??

4 Answers   DST Global Solutions,


Hi, How to give drop down values as input [Variable] from data table in QTP? If u know share with me.

3 Answers  


We have opened three browser such as Facebook,Gmail,Amazon,I want to generate the script of Login of Amazon application, but while adding the object such as edit box(user id,password) in OR is not added.Could you please resolve my issue

1 Answers   IBM,


How to retrieve data from application objects?

1 Answers  


After creating testcases, how do you start testing in QTP? what methodology will follow?

7 Answers   Actran, American Well,


If I am scripting Web-based Surveys using QTP that open up differently but at the exact same point require a username and password can I automate that username and password for all the surveys some how using QTP?

0 Answers  


HOW TO CONVERT MANUAL TEST CASES IN TO AUTOMATION TEST SCRIPTS EXPLAIN THE PROCESS?

0 Answers   ADP,


In qtp, explain what is crypt object

0 Answers  


Out of 3 recording modes. 1.Standard 2.Analog 3.Low-level, which one is commonly used. As per my knowledge, Analog is used for Graphs , barcoding or DIgital signatures.

0 Answers  


Categories