Ok, I've been using RegExp a number of times but for some reason I cannot get it to work this time. I am trying to test for latitude (0 to +/- 90 degrees). No matter what expression I use, it always returns false. Here's my code:
var regexLatitude = new RegExp("^-?([1-8]?[0-9]\.{1}\d{1,6}$|90\.{1}0{1,6}$)");
var status = regexLatitude.test("89.5");
I also tried without quotes:
var status = regexLatitude.test(89.5);
Any idea?