Regular expression for GMT expression

  • Thread starter Thread starter Christian Staffe
  • Start date Start date
C

Christian Staffe

What would be the exact regular expression to match GMT strings like "GMT",
"GMT+01:30", "GMT-02:00", GMT+05:45...

Christian
 
My earlier would have worked but would have matched if there were multiple
+/- signs.

Sorry, get rid of the * --> GMT[+-]\d{2}:\d{2}

This reads: Match the literal string 'GMT', followed by either of + or -,
followed by two digits, followed by a colon, followed by two digits.
 
Back
Top