import re


def get_multi_fields(pattern, o):
    """Extract multiple regex fields from a string."""
    if isinstance(pattern, str):
        pattern = re.compile(pattern)
    m = pattern.search(o)
    if m:
        return m.groups()
    else:
        return None