Matching times


show more Matching times provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions show less
please wait ...

Matching times

In this movie, we'll learn how to write regular expressions to match times. When working with times, it's important to first decide what time formats we're going to be working with, even more so than when we were working with dates, because times can come in a lot of different formats. For example, we have to decide, are we working with 12 hour, or 24 hour formatted time? And if it's 12 hour, will a.m. and p.m. be in uppercase, lowercase, or both? Can there be a leading 0 in front of hours with single digits? Will we include seconds, or just work with the hour and minute? Will we include a time zone at the end? And if we have a time zone, is it going to be a three letter abbreviation, or expressed as an offset from Greenwich Mean Time? The answer to these questions and more will determine the regular expressions that we need.

Let's look at some sample times. So there is the simplest one, which is just 2:34. 2 o'clock, and 34 minutes, with a colon in between. We can p...

Matching times
Video duration: 8m 59s 5h 36m Intermediate

Viewers:

Matching times provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions

Subject:
Developer
Software:
Regular Expressions
Author:
please wait ...