(input_string: str)
| 229 | |
| 230 | @lru_cache(maxsize=100) |
| 231 | def 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 | |
| 240 | async def resolve_medium_short_link(short_url_id: str, timeout: int = 5) -> str: |
no outgoing calls
no test coverage detected