from typing import Optional
import re


def parse_to_n_digit(url: str) -> Optional[str]:
    """Parses a n-hentai url to its digit."""

    n_digit_match = re.search('([1-9][0-9]*)', url)
    return n_digit_match.group(1) if n_digit_match is not None else None