codemirror/CodeMirror — pull request #2939 by JasonBarnabe (2014-11-22 21:07:31+00:00)
Title: Do a string search if a bad regexp is entered

http://codemirror.net/demo/search.html

Put `/+/` somewhere in the textbox. Now do a search for `/+/`. Nothing found! Since it starts and ends with `/`, CodeMirror thinks it's a regular expression. `/+/` is not a valid regular expression, so creating a `RegExp` fails, and the search does nothing.

With this PR, if creating the `RegExp` fails, it will perform a regular string search.