I need a RegEx that can handle an integer between 1 – 999 or time MM:SS from 00:00 to 59:59. This was my attempt ^?((\d{1,3})|((([0-9])|([0-5][0-9])):(([0-9])|([0-5][0-9]))))$
I need a RegEx that can handle an integer between 1 – 999 or
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
try that:
(or that if you also need to match things like 0:17 or 17:2 or 3:8):
You need to be aware that when you are matching regexes you are creating a very “simple” parser that consumes characters from left to right.