import re


def get_indices_for_regex(lines_array, regex_expression):
    """ returns a list of the indices in the line_array list of strings,
    that match the given regex_expression
    """
    return [i for i, elem in enumerate(lines_array) if re.match(regex_expression, elem)]