Bug with RegEx error in search (Error: unterminated parenthetical in RegExp)