The `trim()` method is unnecessarily expensive since it does actual string manipulation (allocates new string and copies data) but all you want to do is search the string. You should use the `_matchExpressions()' function here instead.