You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue applies to both Latitude and Longitude classes.
super("^(?<latitude>[NS]\\d+)$", prio);
The named group is obsolete, as it matches the whole regex. I'd suggest to either
split the expression to proper groups, e.g. "^([NS])(\\d{1,3})(\\d*)$" (with or without names) and read only groups, or
have a simple regex "^[NS]\\d+"$ and read characters/substrings at know indices.
It also may be wise to be strict with number of digits, e.g. "^([NS])(\\d{3})(\\d{2})?$" as this is what the EU 373 + 1338 and ICAO Annex 3 say. And we cannot be certain of the correct interpretation if number of digits mismatch - it may be better to raise a syntax error.
This issue applies to both Latitude and Longitude classes.
super("^(?<latitude>[NS]\\d+)$", prio);
The named group is obsolete, as it matches the whole regex. I'd suggest to either
"^([NS])(\\d{1,3})(\\d*)$"
(with or without names) and read only groups, or"^[NS]\\d+"$
and read characters/substrings at know indices.It also may be wise to be strict with number of digits, e.g.
"^([NS])(\\d{3})(\\d{2})?$"
as this is what the EU 373 + 1338 and ICAO Annex 3 say. And we cannot be certain of the correct interpretation if number of digits mismatch - it may be better to raise a syntax error.Originally posted by @petringo in #117 (comment)
The text was updated successfully, but these errors were encountered: