Fix bug with regex search.