度分秒的正则表达式:

^[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

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-10-22
  • 2021-09-14
  • 2021-10-16
  • 2021-09-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
相关资源
相似解决方案