import re


def match(pattern, text):
    """
    A quick way to do pattern matching.

    NOTE: name tokens using (?P<name>pattern)
    """
    m = re.match(pattern, text)
    if m is None:
        return {}
    else:
        return m.groupdict()