import re


def filter_by_regex(items, regex):
    """
    Helper function that matches regex 'regex' to all elements of a list
    'items' and returns a boolean array of matches of len == len(items).
    """
    return list(filter(lambda x: re.match(regex, x), items))