Regex fix and search terms encode