from typing import Optional
import re


def _parse_url(url: str) -> Optional[str]:
    """Parse a pastecord url"""
    match = re.search(r"pastecord.com(?:/raw|/documents)?/(\w+)(?:\.\w+)?", url)
    if match is None:
        return None
    return match.group(1)