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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Longitude Validator
Expression
^(\+|-)?(\d\.\d{1,6}|[1-9]\d\.\d{1,6}|1[1-7]\d\.\d{1,6}|180\.0{1,6})$
Description
Matches decimal longitude format like that returned by Google maps. Matches from -180.000000 to +180.000000 with between one and six decimal places.
Matches
180.0 -180.000000 +0.123 -34.675421
Non-Matches
09.123 181.345678 -190.000000
Author Rating: The rating for this expression. Nix
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

Title: Doesn't work (edit)
Name: Problem with this code (edit)
Date: 11/24/2010 11:07:07 AM
Comment:
I realize in my last post I listed to 7 decimal places, however, that is not what the problem is because I tested several variations including this one which is only 5 decimal places: -101.51676 (The problem is that it won't let you enter a zero in the second position which is needed for valid values.)


Title: Doesn't work
Name: Problem with this code
Date: 11/24/2010 9:53:43 AM
Comment:
The following regex does not work with the following coordinate: -101.5167627


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