RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find XY Coordinates
Expression
((X|x):-?(180(\.0+)?|[0-1]?[0-7]?[0-9](\.\d+)?))([ ]|,)*((Y|y):-?(90(\.0+)?|[0-8]?[0-9](\.\d+)?))
Description
Latitude and Longitude in Decimal Degrees useful for X (longitude), Y (latitude) coordinate systems such as WGS84. Prefix x: and y: must be used in order. X range: -180.00 to 180.00 Y range: -90.00 to 90.00
Matches
x:180.00, , ,,, Y:-90.000 | x:180y:-90 | X:179.99999, Y:-89.99 | X:50 y:5.540 | x:050y:05.123 | x:0, y:0 | X:-179.99999, Y:-89.99 | X:-180, y:-90 | x:-180.00, Y:-90.000
Non-Matches
x:-180.01, y:-90.001 | x:-180., y:-90. | x:180.01, y:90.001 | x:180., y:90. | x:180-y:90
Author Rating: Not yet rated. David Jacobs
Source Self-built
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: fails on 2 character x coordinates in the 80s and 90s
Name: c. moses
Date: 11/5/2014 4:52:00 PM
Comment:
example: x:-99.12345,y:54 one solution is to add another alternation for 2 digit x coordinates, e.g., (180(\.0+)?|[0-1][0-7]?[0-9](\.\d+)?|[0-9]?[0-9](\.\d+)?) although there is probably a better way.


Title: fails on 2 character x coordinates in the 80s and 90s
Name: c. moses
Date: 11/5/2014 4:51:52 PM
Comment:
example: x:-99.12345,y:54 one solution is to add another alternation for 2 digit x coordinates, e.g., (180(\.0+)?|[0-1][0-7]?[0-9](\.\d+)?|[0-9]?[0-9](\.\d+)?) although there is probably a better way.


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials