Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (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

This will break the datetime string into it's individual parts and add them into named groups.

Submitted by Tony Hume - 4 years ago