MCPcopy Create free account
hub / github.com/Freedium-cfd/web / extract_hex_string

Function extract_hex_string

medium-parser/medium_parser/utils.py:231–237  ·  view source on GitHub ↗
(input_string: str)

Source from the content-addressed store, hash-verified

229
230@lru_cache(maxsize=100)
231def extract_hex_string(input_string: str) -> str:
232 # First try to find a hexadecimal string preceded by a '-'
233 match = re.findall(r"-(\b[a-fA-F0-9]{8,12}\b)", input_string)
234 if not match:
235 # If no match, try to find a hexadecimal string without the '-'
236 match = re.findall(r"(\b[a-fA-F0-9]{8,12}\b)", input_string)
237 return match[-1] if match else None
238
239
240async def resolve_medium_short_link(short_url_id: str, timeout: int = 5) -> str:

Callers 2

resolveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected