Use regex for content search to fix "string not found" bug

(Also tidied up some of the search code)