Abstracted get_search_regex for future testing