MCPcopy
hub / github.com/rspeer/python-ftfy / decode_match

Function decode_match

ftfy/fixes.py:386–388  ·  view source on GitHub ↗

Given a regex match, decode the escape sequence it contains.

(match: Match[str])

Source from the content-addressed store, hash-verified

384 """
385
386 def decode_match(match: Match[str]) -> str:
387 "Given a regex match, decode the escape sequence it contains."
388 return codecs.decode(match.group(0), "unicode-escape")
389
390 return ESCAPE_SEQUENCE_RE.sub(decode_match, text)
391

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected