Latitude and Longitude Regular Expression

A regular expression to parse and validate Latitude and Longitude values.

/^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/

Latitude and Longitude Examples:

  • 47.1231231, 179.99999999
  • +90.0, -127.554334
  • -90.000, -180.0