Regex is too greedy, see example related to WGS84 service:
Input
This message was sent via Telegram to chat, where bot is member:
Title - Coords - Note
Title1 - 50.087451,14.420671 - some note
Title2 - 50.087451,13.420671 - another note
Expected output
Message from bot related to detected locations with coordinates 50.087451,14.420671 and 50.087451,13.420671.
Real output
Message from bot related to detected locations with coordinates -50.087451,-14.420671 and -50.087451,-13.420671.
Todo
It does not makes sense to keep space between - and actual coordinate, so - 50.087451 must always result in parsing 50.087451. But keep support for N 50.087451 and S 50.087451 resulting in 50.087451 and -50.087451 respectively
It does not make sense to use - after coordinate (with or without space), so 14.420671 - must always result in 14.420671. But keep support for 14.420671W, 14.420671 W resulting in -14.420671 and -14.420671 respectively.
Regex is too greedy, see example related to WGS84 service:
Input
This message was sent via Telegram to chat, where bot is member:
Expected output
Message from bot related to detected locations with coordinates
50.087451,14.420671
and50.087451,13.420671
.Real output
Message from bot related to detected locations with coordinates
-50.087451,-14.420671
and-50.087451,-13.420671
.Todo
-
and actual coordinate, so- 50.087451
must always result in parsing50.087451
. But keep support forN 50.087451
andS 50.087451
resulting in50.087451
and-50.087451
respectively-
after coordinate (with or without space), so14.420671 -
must always result in14.420671
. But keep support for14.420671W
,14.420671 W
resulting in-14.420671
and-14.420671
respectively.