Regular Expressions 101

Community Patterns

ISO-8601 date parse

0

Regular Expression
ECMAScript (JavaScript)

/
^(\d{4}|\+\d{6})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.{0,1})(\d{0,})(Z|([\-+])(\d{2})(?::{0,1})(\d{2}))?)?)?)?$
/
gm

Description

Works with 2015-04-03T13:56:24.0+00:00 (official) format, and 2015-04-03T13:56:24+0000 (PHP) format, too Also: 2015-12-31

Submitted by Norbi - 4 years ago