import re


def path_contain_regex(path, path_reg=None):
    """
    test if a path string contains regular expression 
    """
    if path_reg is None:
        return True
    return bool(re.search(path_reg, path))