Themes: Improve RegExp pattern for search.

* The replacement of spaces is now done globally.
* The search term is now escaped for RegExp meta characters.

props westonruter for the hint.
fixes #27479.

git-svn-id: https://develop.svn.wordpress.org/trunk@27649 602fd350-edb4-49c9-b593-d223f7449a82