update escape search pattern function