Title |
Test
Find
Longitude (decimal)
|
Expression |
^-?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[1-7][0-9])(?:(?:\.[0-9]{1,6})?))$ |
Description |
[-180.000000 ... 180.000000]
Decimal places: up to 6.
You can increase precision by replacing {1,6} with {1,your_number} |
Matches |
-180; -180.0; -179.99; 0.000; 179.99; 180.0; 180 |
Non-Matches |
-200; -180.1; 180.1; 200 |
Author |
Rating:
Zygimantas Berziunas
|
Source |
http://www.berziunas.com |
Your Rating |
|
Title: Doesn't work for my longitude of 104.5
Name: Tori Kelly
Date: 12/31/2020 10:55:25 PM
Comment:
Please edit this regex to allow a 0 in the tens place.
Title: Regex has an error
Name: Scott
Date: 9/29/2011 3:42:52 PM
Comment:
The regex string for Longitude won't allow anything between 100 and 109. It appears that this is because the second digit in three number strings if being limited to [1-7]. If I change 1[1-7][0-9] to 1[0-7][0-9], it works fine.