I need to validate the just the format of the entered string for Latitude and Longitude and not if its a correct value for Latitude or Longitude.
The format Latitude 89:90:00N or 67:90:76 S and for Longitude 67:23:00E or 78:23:45W
I am using the below expression for which I am getting a false
if (!Regex.IsMatch(currentValue, "^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][N][S]$"))
Errors.Text = "Invalid format of Latitude;
Please correct me where am I going wrong..I need to validate if its either N or S (without case sensitivity).
You have made both
NandSmandatory.should work. This will also reject invalid entries like
190:67:75Eor99:99:99S.