The other answers that I see do not take into account that longitude goes from -180 to 180, and latitude goes from -90 to 90.
The correct regular expression for this would be (assuming the order is "latitude, longitude"):
/^(-?[1-8]?\d(?:\.\d{1,6})?|90(?:\.0{1,6})?),(-?(?:1[0-7]|[1-9])?\d(?:\.\d{1,6})?|180(?:\.0{1,6})?)$/
This regular expression spans at least -90 and not more than 90 for latitude, as well as at least -180 and not more than 180 in longitude, allowing them to place integers, as well as any number of decimal places from 1 to 6, if you want to allow more precision, just change {1,6} to {1, x}, where x is the number of decimal places
In addition, if you capture group 1, you will get latitude, and capture by group 2 will get longitude.
source share