import re


def get_all_fields(pattern, o):
    """Extract the repeating instances that match a same single regex pattern."""
    if isinstance(pattern, str):
        pattern = re.compile(pattern)
    return pattern.findall(o)