"""Characters that can wrap a number, symbol or unit: `(kg)`, `[V]`, `{m}`, `"m"`, `«V»`.""" import re OPEN_CHARS = "([{\"“«‘'" CLOSE_CHARS = ")]}\"”»’'" OPENERS = "[" + re.escape(OPEN_CHARS) + "]" CLOSERS = "[" + re.escape(CLOSE_CHARS) + "]" WRAPPERS = "[" + re.escape(OPEN_CHARS + CLOSE_CHARS) + "]"