经纬度正则表达式记录

经度

^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$

纬度

^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$

参考资料:
https://stackoverflow.com/questions/3518504/regular-expression-for-matching-latitude-longitude-coordinates

发布了96 篇原创文章 · 获赞 95 · 访问量 39万+

猜你喜欢

转载自blog.csdn.net/yh0503/article/details/105034861