import re


def series_extract(series, search, flag):
    """Extract named groups from strings."""
    result = series.str.extract(search, expand=False, flags=re.DOTALL)
    no_integers = [x for x in result.columns.values if not isinstance(x, int)]
    return result[no_integers].copy()