Regular Expressions 101

Library entries

Breakdown datetime stamp into parts (YYYY-MM-DD[T]HH:MM:SS)

Vote

0

Regular Expression
javascript

/
(?<year>[\d]{4})-(?<month>0[1-9]|1[1-2])-(?<day>0[1-9]|[1-2][0-9]|3[0-1])T(?<hour>[0-1][0-9]|2[0-3]):(?<minute>[0-5][0-9]):(?<second>[0-5][0-9])(?:Z|.(?<millisecond>[0-9]{2,3}))
/
gmi

Description

Loading markdown...
Submitted by Tony Hume - 8 months ago