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 https://github.com/fmidev/fmi-avi-messageconverter-tac/pull/117#discussion_r989994665_