Regular Expressions 101

Community Patterns

match time offset from timezone offset string

1

Regular Expression
ECMAScript (JavaScript)

/
(?<=(UTC|GMT))([+-])((\d{2}:\d{2})|(\d{4}|\d{2}))\b
/
gmi

Description

match offset from utc offset string returned by the timeZoneName property of an Intl.DateTimeFormat object. (see MDN documentation here)

Submitted by Lagoffre - 2 months ago (Last modified 2 months ago)