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

经纬度: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]; // 提取秒
}
相关推荐
坐吃山猪10 小时前
Python09_正则表达式
开发语言·python·正则表达式
橙露16 小时前
Python 正则表达式:文本清洗与信息提取速通手册
python·正则表达式·easyui
XiaoQiao6669993 天前
pytnon中正则表达式小题详解
python·正则表达式
gCode Teacher 格码致知3 天前
Python基础教学:正则表达式中的忽略大小写以及符号“-“的问题-由Deepseek产生
python·正则表达式
ths5124 天前
Python 正则表达式实战指南:从入门到精通(12 个高频案例)(三)
python·正则表达式
ths5124 天前
Python 正则表达式学习笔记(小白超详细版)(一)
python·正则表达式
kcuwu.6 天前
Python 正则表达式从入门到实战
数据库·python·正则表达式
羊小蜜.6 天前
Mysql 07: 正则表达式查询(REGEXP)全解
数据库·mysql·正则表达式
Dxy12393102166 天前
正则表达式如何匹配提取文章日期
数据库·mysql·正则表达式
Dxy12393102169 天前
Python正则表达式判断姓名:详细解析
python·mysql·正则表达式