Your original regular expression has flaws: it wouldn’t match 04:00
for example.
This may work better:
^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$
More Related Contents:
- Phone number regular expressions exact format
- Greedy vs. Reluctant vs. Possessive Qualifiers
- RegEx: Grabbing values between quotation marks
- Regular Expression to match valid dates
- In regex, match either the end of the string or a specific character
- How to match numbers between X and Y with regexp?
- Searching for UUIDs in text with regex
- What regular expression will match valid international phone numbers?
- How to check that a string is a palindrome using regular expressions?
- Regular expression that doesn’t contain certain string [duplicate]
- Regular expression search replace in Sublime Text 2
- Phone validation regex
- Regex for alphanumeric, but at least one letter
- regex to match word boundary beginning with special characters
- Random Text generator based on regex [duplicate]
- Does the ‘o’ modifier for Perl regular expressions still provide any benefit?
- Microsoft office Access `LIKE` VS `RegEx`
- Why are there so many different regular expression dialects?
- How to replace a whole line with sed?
- Unix grep regex containing ‘x’ but not containing ‘y’
- What regular expression can never match?
- is there something akin to regEx in applescript, and if not, what’s the alternative?
- Regular Expression Validation For Indian Phone Number and Mobile number
- How can I parse quoted CSV in Perl with a regex?
- htaccess force https and redirect www to non-www, but no other subdomains
- Checking for diacritics with a regular expression
- Filtering a diff with a regular expression
- Redirect all traffic to root of another domain
- ignoring changes matching a string in git diff
- Regex allow digits and a single dot