from typing import Optional
import re


def parseResourceId(resource_uri: str, resource_type: str) -> Optional[str]:
    """Parses the resource ID of the given type from the given URI, or returns None if not found."""
    matches = re.search('{}/([^/]+)'.format(resource_type), resource_uri)
    if not matches:
        return None

    return matches.group(1)