def string_literals(patterns, text):
    if patterns is None or text is None:
        return []
    return [p for p in patterns if p in text]