Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<lat>-?\b(?<!\b-)\d+\.\d+)(?<comma>,)(?<long>-?\d+\.\d+)\b
/
gm
Input 1
1
New
sample of strings that are working: 11.18531,88.78292,8.34329,123.48655, 21.11912,145.85430, 36.29781,-13.06121, -16.35564,-36.07065, 31.86691,122.28366, 38.84814,-140.10204, 18.58158,59.20813 Here I want to extract the latitude and longitude values with their - signs. But there are some patterns of string which I want to reject completely: -76.84933,-141.64907hel, no-16.3993,-11.2359, -77.7678er,161.9786, 69.8149,-l61.9041, 5.9333,10.1rr667, jkl11.18531,88.78292hh