title: How to check for valid time format?
body: <p>I am trying to check if a string variable conforms to either hh:mm AM or hh:mm PM twelve hour time format. Where hh represents hours, mm represents minutes and AM or PM represents morning or evening. I have a CSV file where each line contains a time in 12-hour format for instance 01:00 PM or 12:00 AM. I am extracting each line and checking if it conforms to the desired format.</p>