fix to use compiled regexp objects, and use pattern conversion on smartsearch too