import re


def pattern(message, args, pipeline_data):
    """ Tests the message data against a regex pattern """
    text = message.get("data", None)
    pattern = args[0]
    if text != None:
        return re.search(pattern, text)
    return None