do not wrap regular expresssions in '^' and '$', only strings.
Merge pull request #4177 from dloverin/pref-regexp-fix

do not wrap regular expresssions in '^' and '$', only strings.