import re


def search_for_pattern(pattern, text):
    """
    Generic function that encapsulate the search for the first occurence of a pattern that may not exist.
    (re.search). Case insensitive and pattern cannot start or end in the middle of a word.
    Return : match object or None
    """
    
    return re.search("\\b"+pattern+"\\b",text, re.IGNORECASE)