I have to build a regular exp which will accept all the numbers from 0 to 168 followed by "N" or "S".
I have prepared the following regular exp which is working fine except that it considers 168.11 as valid input.
Regular Exp:
/\b([1-9]|[1-9][0-9]|1[01][0-9]|16[0-8])(\.\d{1,2})?[N,S]?$/
Valid:
168S
11.2
10
140
125N
130S
3S
3.2
168.00S
Invalid:
168.11
168.12S
168.12N
Can anyone suggest what I am missing? Thank you!
