def METHOD_NAME(cls, source):
    """extract a policy oject from the policy string
    temporarily, the policy object is a tuple, e.g., ('rlrl', 'hq').
    """
    for name, p in cls.rules:
        regex = re.compile(p)
        m = regex.match(source)
        if m is not None:
            return name, m.group(1)
    raise ValueError('invalid policy string: rule not found')