import re


def get_tokens_flags(case_sensitive):
    """Returns flags for regular expression matching depending on text analysis
    options
    """
    flags = re.U
    if not case_sensitive:
        flags = (re.I | flags)

    return flags