I would like to validate and extract the hours and minutes from a string using Regex in .NET.
Just to recuperate the two numbers, separated(or not) by :
. Accepted format
h:m
or m
. Unaccepted :m
, h:
.
EDIT: This is to note, that the number of hours could overflow the 23 till... 32.
The overflow for hours(over 32) and minutes(over 59) I will do after values recuperation(int.Parse)
* just for fun maybe there a a relative simple regex that could filter also the >32 for hour and >59 for minute (for minutes it could be [0-5]*[0-9]
, for hours I don't know)?