Click here to Skip to main content
15,908,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i try the regular expression

/^(99|[0-9]?[0-9])[D:]([01]?[0-9]|2[0-3])[H:]([0-5][0-9])[M] $/


the Format string value is
99D:23H:59M


It can accept 99days:23Hours:59 Minites it should be validated

can any one help me out

thanks
parithi

What I have tried:

i tried in google and come up with this expression but its not working
/^(99|[0-9]?[0-9])[D:]([01]?[0-9]|2[0-3])[H:]([0-5][0-9])[M] $/
Posted
Updated 18-Apr-16 0:00am
v2

1 solution

Try:
/^(\d\d|\d)D:([01]?\d|2[0-3])H:([0-5]\d)M$/

If you want to work with regexes, get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900