I have made this regex
^(00|0[0-9]|1[012]):[0-5][0-9]? ((a|p)m|(A|P)M)$
but the problem is it is accepting 00:00 am which i dont want to
You could use:
Regex.IsMatch(input, @"^(0[1-9]|1[0-2]):[0-5][0-9] [ap]m$", RegexOptions.IgnoreCase);