import re


def read(line_str, line_pos, pattern='[0-9a-zA-Z_:?!><=&]'):
    """
    Read all tokens from a code line matching specific characters,
    starting at a specified position.

    Args:
        line_str (str): The code line.
        line_pos (int): The code line position to start reading.
        pattern (str):  Regular expression for a single character. All matching
                        characters will be read.

    Returns:
        literal (str):  The literal that was read, including only characters
                        that were defined in the pattern argument.
        line_pos (int): The updated line position.
    """
    length  = len(line_str)
    literal = ''
    while line_pos < length and re.match(pattern, line_str[line_pos]):
        literal  += line_str[line_pos]
        line_pos += 1
    return literal, line_pos