def extract(pattern, string, *, assert_equal=False, one=False,
            condense=False, default=None, default_if_multiple=True,
            default_if_none=True):
    """
    Used to extract a given regex pattern from a string, given several options
    """

    if isinstance(pattern, str):
        output = get_content(pattern, string)
    else:
        # Must be a linear container
        output = []
        for p in pattern:
            output += get_content(p, string)

    output = process_output(output, one=one, condense=condense,
                            default=default,
                            default_if_multiple=default_if_multiple,
                            default_if_none=default_if_none)

    if assert_equal:
        assert_output(output, assert_equal)
    else:
        return output
def extract ( pattern , string , * , assert_equal = False , one = False , condense = False , default = None , default_if_multiple = True , default_if_none = True ) : if isinstance ( pattern , str ) : output = get_content ( pattern , string ) else : output = [ ] for p in pattern : output += get_content ( p , string ) output = process_output ( output , one = one , condense = condense , default = default , default_if_multiple = default_if_multiple , default_if_none = default_if_none ) if assert_equal : assert_output ( output , assert_equal ) else : return output
Used to extract a given regex pattern from a string, given several options