有人用正则表达式从字符串中删除lat / long吗?如:
ID:39.825 -86.88333
解决方法:
var latlong = 'ID: 39.825 -86.88333';
var point = latlong.match( /-?\d+\.\d+/g );
//result: point = ['39.825', '-86.88333'];
2023-02-07 18:52:23
有人用正则表达式从字符串中删除lat / long吗?如:
ID:39.825 -86.88333
解决方法:
var latlong = 'ID: 39.825 -86.88333';
var point = latlong.match( /-?\d+\.\d+/g );
//result: point = ['39.825', '-86.88333'];