Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$
/
gm
Input 1
2016-07-16T19:20:30+5:30 2016-07-16T19:20:30+05:30 2019-09-03T20:16:24+01:00 2019-09-03T20:16:24-01:00 2016-07-16T19:20:30Z
Substitution
2016-07-16T19:20:30+5:30 2016-07-16T19:20:30+05:30 2019-09-03T20:16:24+01:00 2019-09-03T20:16:24-01:00 2016-07-16T19:20:30Z