Website link where I tested regex
var string = "12.0,34.0";
var re = new RegExp("[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+))?");
if (re.test(string)) {
console.log("Valida");
} else {
console.log("Invalida");
}
Recalling what appears on my console is invalid! I have tested with other simple expressions and it works perfectly the code if someone knows the solution is that I know little or nothing about regex