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

Can any one brief some detail on how the shared and action object repository utilized/implemented in a real time project. I already know how to make shared object repositor by saving OR as .tsr extension..I wanted the actual concept of implementation...couple of live examples will be highly appreciated. Thanks

0 Answers  


Whether qtp 9.0 supports Test director8.0

0 Answers   TCS,


Write VB script to test given number is Prime Number

5 Answers   Oracle,


How we will execute(run) the scripts in qtp 8.2?

1 Answers  


What is fragmentation and paging?

0 Answers  






In qtp, how you can exit for loop?

0 Answers  


what is clean sweep?

0 Answers  


What are the common defects found in your project? (in qtp interview)

0 Answers   TCS,


After running scripts how you report results ,there is any specific report form

5 Answers   Novartis,


Browser("Las Vegas Hotels - Las").Page("Vegas Hotels - Hotels").Link("Luxor") ......here Luxor is a hotel and this is recognised as a link. I have many hotels like Luxor, Palms etc which are all displayed as link...How do I parametrize this by using webtable functions??? ASAP

1 Answers   HP,


why don’t use real time they r not using check points

1 Answers   Wipro,


what is objectidentification?

2 Answers  


Categories