度分秒的正则表达式

 度分秒的正则表达式:

^[EW]?((d|[1-9]d|1[0-7]d)[s-,;°度](d|[0-5]d)[s-,;′'分](d|[0-5]d)(.d{1,2})?[s-,;/""秒]?$)

匹配字符:

18°12'23.34"

1°12'23.34"

168°12'23.34"

18°01'09.34"

经度:

^[EW]?((d|[1-9]d|1[0-7]d)[s-,;°度](d|[0-5]d)[s-,;′'’分](d|[0-5]d)(.d{1,2})?[s-,;/""”秒]?$)

纬度:

^[EW]?((d|[1-8]d)[s-,;°度](d|[0-5]d)[s-,;′'’分](d|[0-5]d)(.d{1,2})?[s-,;/""”秒]?$)

匹配字符:89°01’09.34”

分和秒的字符还这是麻烦。需要分析一下。

参考:

http://blog.csdn.net/qqmagicer/article/details/647622

http://blog.sina.com.cn/s/blog_9ed7f0d70101g9qr.html

原文地址:https://www.cnblogs.com/yhlx125/p/3587341.html