Avatar of Ashok Ash
Ashok Ash
 asked on

Need regular expression for timeslot

The timeslot format is HH:MM AM/PM - HH:MM AM/PM (example -   08:00AM-10:00AM) Need regular expression to validate this
Regular ExpressionsJava

Avatar of undefined
Last Comment
Rgonzo1971

8/22/2022 - Mon
CEHJ

example -   08:00AM-10:00AM
Try
"\\d{2}:\\d{2}[AP]M-\\d{2}:\\d{2}[AP]M"

Open in new window

ASKER CERTIFIED SOLUTION
Rgonzo1971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rgonzo1971

A solution
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy