dbarbalato / magellan

JavaScript Latitude and Longitude Validation and Formatting
18 stars 12 forks source link

support for wikipedia lat lng characters #1

Closed robcleghorn closed 10 years ago

robcleghorn commented 11 years ago

I've modified the regex to support wikipedia lat lng chars. DMS_FORMATREGEX = (/^[NSEW]?\s(\d{1,3})°?\s(?:(\d{1,2})[',′]?\s(?:(\d{1,2}(?:.\d+)?)[",″]?\s_)?)?\s*[NSEW]?$/);

dbarbalato commented 11 years ago

Happy to see you're interested. Could you provide an example of a string that your modified regex will match?

I would encourage you to fork and I'll merge it all in when you are done. Thanks for the improvement - Cheers!

robcleghorn commented 11 years ago

51° 30′ 26″ N, 0° 7′ 39″ W

robcleghorn commented 11 years ago

PS i've converted it to typescript so forking is probably not very useful for you. Thanks for sharing!