Search, insert, replace, and clean functions