import re


def re_match(pattern, alist, ignore_case=False):
    """
    Filters a list with a regexpr pattern and returns an iterator

    Paramters
    ---------
    @pattern: str
        Regular expression pattern
    @alist: list
        A list to filter
    @ignore_case: bool
        Whether to ignore cases. Default ignores case

    Examples
    --------
    > list(re_match('ab\.*', ['abc', 'about', 'adobe']))
    > ['abc', 'about']
    """
    flags = re.IGNORECASE if ignore_case else 0
    return filter(re.compile(pattern, flags=flags).match, alist)