import re


def extract_jump(message, args, pipeline_data):
    """
    Extracts a jump command from the data, and proceeds to the next step.
    Jump commands have the same syntax as Go To Anything
    e.g.:
        @ to jump to a symbol
        : to jump to a line
        # to jump to an instance of the text

    NOTE: the jump command is removed from the data. This is useful for subsequent tests like
          is_file, as otherwise the jump command will cause it to fail

    Returns a tuple containing (type, location)
    """

    text = message.get("data", None)
    if text != None:
        match = re.search("([@#:])([^@#:]+?)$", text)
        if match:
            message['data'] = text[0:match.span(1)[0]]
            return (match.group(1), match.group(2))
    return (None,None)