from typing import Optional
import re


def _read_url_slug(file_contents: str) -> Optional[str]:
    """Returns slug parsed from file contents, None if not found."""
    regex = r"""url=[^"]+\.[^"]+\/(?P<slug>[-\w]+)(\/|[\w.]+)?\""""
    match = re.search(regex, file_contents, re.VERBOSE)
    if match:
        return match["slug"]
    return None