I am trying to make a validates_format_oflatlng object that is returned from the Google Maps API. My map is configured perfectly, so when I click on a point on the map, it fills the text box with latlng (which looks like this: 46.320615137905904, 9.400520324707031). I save this value as a string in db (which I then parse to put markers on the map later), but I need to check the sting format as two floats (positive or negative) with a comma between them.
I know that this is possible with a regex, but for my life it was not possible to compute a string of regexes to make it work.
Any help would be appreciated super! Thank you Jeff
source
share