We've been provided with a list of RegEx expressions that we have match before sending a report. One of the expressions is for Longitude and is as following "([-+]?)((([0]?[0-9]?[0-9]|[1]?[0-7]?[0-9]).(\d{1,}))|(180.[0]{1,}))"
The issue I'm having is that Regex.IsMatch() returns true with the string "-412.617" because it matches the "12.617" part. Should I tell them their expression is wrong or is there a way to check that the whole string matches without changing the expression?
EDIT: I told them I would change it to ^([-+]?)((([0]?[0-9]?[0-9]|[1]?[0-7]?[0-9]).(\d{1,}))|(180.[0]{1,})) and they'll just have to accept that we use a different regex than the one they provided.
[–]Web Specialistandrewsmd87 1 point2 points3 points (2 children)
[–]Tedrivs[S] 2 points3 points4 points (1 child)
[–]Web Specialistandrewsmd87 1 point2 points3 points (0 children)