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

经纬度: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]; // 提取秒
}
相关推荐
TOWNST11 分钟前
正则表达式使用知识(日常翻阅)
java·python·正则表达式
XU磊26037 分钟前
深入 Java 正则表达式源码:透视 Matcher.group(int) 的分组提取机制
正则表达式
斯内科2 天前
Python进阶(1):正则表达式
python·正则表达式
程序员总部2 天前
Python中如何用正则表达式精准匹配IP地址?
python·tcp/ip·正则表达式
王小二_Leon2 天前
JAVA中正则表达式的入门与使用
java·正则表达式
搜搜秀3 天前
find指令中使用正则表达式
linux·运维·服务器·正则表达式·bash
Jwoka3 天前
正则表达式学习笔记
笔记·python·正则表达式·re
晨曦5432103 天前
python——正则表达式
开发语言·正则表达式
学c真好玩5 天前
4.7正则表达式
正则表达式
刘大猫.5 天前
java导入excel更新设备经纬度度数或者度分秒
java·excel·导入excel·经纬度·度分秒·经纬度 度数·经纬度 度分秒