fix parenthesis and detection of word search in string mode (refs #4078)