Fix issue in showing search results

If the search text contains special regex chars, a php warning is
raised. This edit fixes that.