diff --git a/astropy/units/format/generic.py b/astropy/units/format/generic.py index 391f9607495c..dfabdb3e89b0 100644 --- a/astropy/units/format/generic.py +++ b/astropy/units/format/generic.py @@ -161,7 +161,7 @@ def t_FUNCNAME(t): return t def t_UNIT(t): - "%|([YZEPTGMkhdcmu\N{MICRO SIGN}npfazy]?"+r"'((?!\d)\w)+')|((?!\d)\w)+" + "%|([YZEPTGMkhdcmu\N{MICRO SIGN}npfazy]?'((?!\\d)\\w)+')|((?!\\d)\\w)+" t.value = cls._get_unit(t) return t