Created
April 8, 2015 22:31
-
-
Save vieko/4992386ac3a83cb79bee to your computer and use it in GitHub Desktop.
Regular Expressions for Location Formats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsd: | |
/\D*([0-9]{1,2}|sw|nw|ne|se)\D+([0-9]{1,2})\D+([0-9]{1,3})\D+([0-9]{1,2})\D*(w|e)([0-9])/i | |
uwi_lsd: | |
/\D*(1[0-9A-Z]{2})\D+([0-9]{1,2})\D+([0-9]{1,2})\D+([0-9]{1,3})\D+([0-9]{1,2})\D*(w|e)([0-9])\D([0-9]){2}/i | |
uwi_nts: | |
/\D*(2[0-9A-Z]{2})\W+([A-D]{1})[\s|\-]*(\d+)[\s|\-]*([A-L]{1})[\s|\/|\-]*([0-9]+)[\s|\-]*([A-P]{1})[\s|\-]*([0-9]+)\D([0-9]){2}/i | |
nts: | |
/([A-D]{1})[\s|\-]*(\d+)[\s|\-]*([A-L]{1})[\s|\/|\-]*([0-9]+)[\s|\-]*([A-P]{1})[\s|\-]*([0-9]+)/i | |
utm: | |
/([0-9]+)([N|S])\D+([0-9]+)\D+([0-9]+)/i | |
latlng: | |
/^\s*(\-?\d+(?:\.\d+)?)[,|\s|°]+(\-?\d+(?:\.\d+)?)[\s|°]*$/ | |
address: | |
/(.*),(.*),(.*),?(.*)?/i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment