Since you are parsing strings that have multibyte characters (°), you should add the unicode modifier, i.e. u
at the end of the regex.
/ /u
Just as an illustration: without that modifier, if you would add a .
after \D
, here:
\D.\h*([-EeWw]?)
... then you would capture the "E" in the fourth capture group. So \D.
actually matches the multibyte character °
.