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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Google Maps Latitude,Longitude
Expression
^(?<lat>(-?(90|(\d|[1-8]\d)(\.\d{1,6}){0,1})))\,{1}\s?(?<long>(-?(180|(\d|\d\d|1[0-7]\d)(\.\d{1,6}){0,1})))$
Description
Regular expression for Google's format of Latitude and Longitude (if you were to copy and paste from either the Maps application or the web address). Allows 7 decimal places, and an optional space after the comma. A really small extension to Juergen Jungwirth's expression, to allow an optional space between the commas, and an additional decimal place, which is the format that Google often gives.
Matches
"0,0“, „48.05, 11.9666679, „90,0“, „-90,-180“
Non-Matches
„05.12345,0“, „90.1234,1“, „1,-180.1“, „0,1.1234567“
Author Rating: The rating for this expression. Andy Jones
Source
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

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