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

经纬度: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]; // 提取秒
}
相关推荐
kcuwu.2 天前
Python 正则表达式从入门到实战
数据库·python·正则表达式
羊小蜜.2 天前
Mysql 07: 正则表达式查询(REGEXP)全解
数据库·mysql·正则表达式
Dxy12393102162 天前
正则表达式如何匹配提取文章日期
数据库·mysql·正则表达式
Dxy12393102165 天前
Python正则表达式判断姓名:详细解析
python·mysql·正则表达式
一个小猴子`6 天前
快速了解正则表达式
正则表达式
禾小西7 天前
Java中使用正则表达式核心解析
java·python·正则表达式
Amumu121387 天前
Js:正则表达式(一)
开发语言·javascript·正则表达式
榴莲omega7 天前
正则表达式入门与实战指南
javascript·正则表达式·js八股
披着羊皮不是狼7 天前
正则表达式(Regular Expression) 简明指南
正则表达式
Chen--Xing7 天前
Python -- 正则表达式
python·正则表达式·数据分析·数据脱敏·2025年能源网络安全大赛