Test, validate and match regular expressions
Matches a 12-hour time range such as '9am-5pm', '10 AM - 6 PM', or '2pm to 4pm', where hours run 1-12, AM/PM markers are case-insensitive, and the two times are separated by a hyphen (with optional surrounding spaces) or the word 'to'. It also accepts 'TBD'/'tbd' as a placeholder for undetermined times, plus optional trailing whitespace. Commonly used to validate schedule, availability, or event-time form inputs.