Fixes #3683: check that the regexp is valid before doing the release
Merge pull request #312 from ncharles/bug_3683/dev/validate_regex_in_search

Fixes #3683: check that the regexp is valid before doing the search