Abstracted get_search_regex for future testing
Merge pull request #1823 from koenpunt/abstracted-regex

Abstracted get_search_regex for future testing