In general terms I want to find in the string some substring but only if it is contained there.
I had expression :
^.*(\\bpass\\b)?.*$
A period only matches a single character, so you're
^.(\bpass\b)?.$
is matching:
which I would not expect to match "high pass h3" at all.
The regular expression:
pass
(no metacharacters) will match any string containing "pass" (but then so would a "find string in string" function, and this would probably be quicker without the complexities of a regex).