热卖商品
新闻详情
经纬度正则表达式-java - it610.com
来自 : www.it610.com/article/12818614
发布时间:2021-03-24
经度校验:
/^[\\-\\+]?(0?\\d{1,2}|0?\\d{1,2}\\.\\d{1,15}|1[0-7]?\\d{1}|1[0-7]?\\d{1}\\.\\d{1,15}|180|180\\.0{1,15})$/
纬度校验:
/^[\\-\\+]?([0-8]?\\d{1}|[0-8]?\\d{1}\\.\\d{1,15}|90|90\\.0{1,15})$/
Java代码:
String lonMatch = \"[\\\\-+]?(0?\\\\d{1,2}|0?\\\\d{1,2}\\\\.\\\\d{1,15}|1[0-7]?\\\\d|1[0-7]?\\\\d\\\\.\\\\d{1,15}|180|180\\\\.0{1,15})\";String latMatch = \"[\\\\-+]?([0-8]?\\\\d|[0-8]?\\\\d\\\\.\\\\d{1,15}|90|90\\\\.0{1,15})\";if (!Pattern.matches(latMatch, lat)){ target.remove(\"location\");if (!Pattern.matches(lonMatch, lon)){ target.remove(\"location\");}
2020年7月11日纬度校验: /^[\-\+]?([0-8]?\d{1}|[0-8]?\d{1}\.\d{1,15}|90|90\.0{1,15})$/ Java代码: String lonMatch = "[\\-+]?(0?\\d{1...正则表达式经度校验:/^[\-\+]?(0?\d{1,2}|0?\d{1,2}\.\d{1,15}|1[0-7]?\d{1}|1[0-7]?\d{1}\.\d{1,15}|180|180\.0{1,15})$/纬度校验:/^[\-\+]?([0-8]?\d{1}|[0-8]?\d{1}\.\d{1,15}|90|90\.0{1,15})$/Java代码:StringlonMatch="[\\-+]?(0?\经纬度正则表达式
本文链接: http://matchlon.immuno-online.com/view-693020.html
发布于 : 2021-03-24
阅读(0)
最新动态
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24
2021-03-24