def escape( text ):
    """ escape characters that have meaning in regular expressions """
    ret = ""
    for k in text:
        if k in [".","\\","?","*","[","]","(",")","+"]:
            ret = ret + "\\" + k
        else:
            ret = ret + k
    return ret