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

经纬度: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]; // 提取秒
}
相关推荐
旭日东升的xu.5 天前
Python(09)正则表达式
正则表达式
程序员编程指南6 天前
Qt字符串处理与正则表达式应用
c语言·c++·qt·正则表达式
王柏龙6 天前
正则表达式 \b:单词边界
正则表达式
HashTang10 天前
2025年7月份实时最新获取地图边界数据方法,省市区县街道多级联动【文末附实时geoJson数据下载】
echarts·地图·geojson·全国geojson·经纬度·街道geojson·街道边界数据·矢量边界·乡镇geojson·乡镇边界数据·行政边界
钮钴禄·爱因斯晨11 天前
Java API (二):从 Object 类到正则表达式的核心详解
java·开发语言·信息可视化·正则表达式
愈努力俞幸运11 天前
python 正则表达式
正则表达式
PythonicCC12 天前
Python正则表达式
python·正则表达式
木子杳衫13 天前
【Python】LEGB作用域 + re模块 + 正则表达式
数据库·python·正则表达式
MediaTea14 天前
Python 库手册:re 正则表达式模块
开发语言·python·正则表达式
m0dw16 天前
正则表达式梳理
正则表达式