import re


def find_topic_header(status, pattern, return_group=0):
    """
    Searches a status for the presence of a pattern, and returns matches


    Args:
        status(dict): A dictionary with information for a tweet. Expected to
          include a ``text`` key.
        pattern: A raw string with a regular expression pattern.
        return_group (int): The regex group that may be returned. Defaults to all groups.
    Returns:
        The requested return group for the match or ``None``.
    """
    text = status['text']
    topic_regex = re.compile(pattern, re.I)
    match = topic_regex.search(text)
    if match:
        return match.group(return_group)
    return None