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

经纬度: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]; // 提取秒
}
相关推荐
麦芽糖02192 小时前
python进阶六 正则表达式
android·python·正则表达式
Watermelo6172 天前
理解 JavaScript 中的“ / ”:路径、资源与目录、nginx配置、请求、转义的那些事
前端·javascript·vue.js·chrome·nginx·正则表达式·seo
睡不着的可乐2 天前
正则表达式
正则表达式
Dxy12393102162 天前
Python 使用正则表达式将多个空格替换为一个空格
开发语言·python·正则表达式
2401_827499995 天前
python项目实战11-正则表达式基础
python·mysql·正则表达式
互联网散修5 天前
零基础鸿蒙应用开发第三十三节:正则表达式基础与应用
华为·正则表达式·harmonyos
bukeyiwanshui5 天前
20260414 正则表达式及shell三剑客
数据库·mysql·正则表达式
坐吃山猪6 天前
Python09_正则表达式
开发语言·python·正则表达式
橙露6 天前
Python 正则表达式:文本清洗与信息提取速通手册
python·正则表达式·easyui
XiaoQiao6669998 天前
pytnon中正则表达式小题详解
python·正则表达式