前端使用正则表达式提取经纬度 度分秒值

经纬度:124°0′0.0″,我想提取度分秒

java 复制代码
const regex = /(\d+\.\d+)°\s*(\d+\.\d+)′\s*(\d+\.\d+)″/;
const latMatches = record.latDegreeMinuteSecond.match(regex);
if (latMatches) {
  record.latDegree = latMatches[1]; // 提取度
  record.latMinute = latMatches[2]; // 提取分
  record.latSecond = latMatches[3]; // 提取秒
}
相关推荐
除了辣条不吃辣16 小时前
ABAP 正则表达式
开发语言·正则表达式·abap·alv
吴声子夜歌2 天前
JavaScript——字符串和正则表达式
开发语言·javascript·正则表达式
曾阿伦2 天前
Python 正则表达式备忘录:判断与提取核心用法
python·正则表达式
小张贼嚣张2 天前
SQL 正则表达式详解:语法、函数与实战案例(MySQL/Oracle通用)
mysql·oracle·正则表达式
Zzzz_my2 天前
正则表达式(RE)
pytorch·python·正则表达式
yhole3 天前
SQL中的REGEXP正则表达式使用指南
数据库·sql·正则表达式
ybdesire6 天前
ReDoS(正则表达式拒绝服务攻击)理解与实测
正则表达式·漏洞
weixin_433179336 天前
python - 正则表达式Regex
python·正则表达式
GDAL6 天前
坐标见初心,数据守国土|geocode.com.cn 专业逆地理编码服务
经纬度·地理编码·geocode·钓鱼岛·九段线·省市县乡
wayz118 天前
正则表达式:从入门到精通
java·python·正则表达式·编辑器