How to validate time in 12-hour format using Regular Expression
Given a string str, the task is to check whether the string is valid time in 12-hour format or not by using Regular Expression. The valid time in a 12-hour format must satisfy the following conditions: It should start from 1, 2, ... 9 or 10, 11, 12.It should be followed by a colon(:).It should be fo