import re


def token_in_line(line, token):
    """Find if token is present in string."""
    # the second regex needs to include digits for Base64 vs. Base, Type vs. Type1 etc.
    pattern = r'(^|[^a-zA-Z_]+)' + token + r'($|[^a-zA-Z0-9_]+)'
    p = re.compile(pattern)
    hits = p.findall(line)
    return len(hits) > 0