Regular expression to check timespan

“hh:mm:ss” -match “d|d.hh:mm|d.hh:mm:ss|hh:mm:ss”
“0-12”
“12” -match “0[1-9]|1[012]”
“01” -match “0[1-9]|1[012]”
“62” -match “0[1-9]|1[012]”
“0-59”
“01” -match “^[0-5]?[0-9]$”
“12” -match “^[0-5]?[0-9]$”
“40” -match “^[0-5]?[0-9]$”
“59” -match “^[0-5]?[0-9]$”
“60” -match “^[0-5]?[0-9]$”
“62” -match “^[0-5]?[0-9]$”

As a reminder:

“hh:mm:ss” -match “d|d.hh:mm|d.hh:mm:ss|hh:mm:ss”

“0-12”

“12” -match “0[1-9]|1[012]”

“01” -match “0[1-9]|1[012]”

“62” -match “0[1-9]|1[012]”

“0-59”

“01” -match “^[0-5]?[0-9]$”

“12” -match “^[0-5]?[0-9]$”

“40” -match “^[0-5]?[0-9]$”

“59” -match “^[0-5]?[0-9]$”

“60” -match “^[0-5]?[0-9]$”

“62” -match “^[0-5]?[0-9]$”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s