If the input going into the grep pipe contains square brackets ('[' and ']'), grep will have a hard time handling them gracefully. You must first "sanitize" the input by using something like this to encase each square bracket in a pair of square brackets, thereby causing them to be interpreted as literal characters to be matched:
CommandYouWantToPipeThroughGREP | sed -e 's^\(\)^\[\1\]^g' | grep ...
Explanation of sed command:
sed -e: an expression follows the -e. It must be encased in single or double quotes.
s^: [s]earch for. "^" is being used as a field delimiter. Every time you see "^", it's delimiting a new part of the search option.
\1: escaped parentheses encase a pattern that you want to be able to access as a variable in sed. The first such pattern is referred to as "\1"; the second is "\2", and so on.
: The outer two brackets are encasing the inner two. The first character after a "[" is automatically assumed to be literal (escaped/having no special meaning). Since that first character is a bracket, the next bracket is also assumed to be literal, unless it's the only bracket before the end of that "^"-delimited field. (At least, that's my understanding of how it works...)
\[\1\]: Encase sed variable 1 ("\1") in literal brackets, and send it to output.
g: [g]reedy. It means, "Find and replace all examples of the search text, instead of just the first one".
So, just pipe any input that might contain square brackets through this sed command before piping it through grep, and grep will look for the the brackets literally, instead of interpreting them as special characters. Unfortunately, it would seem that, if you pipe to ANOTHER grep command, after the first one, you need to run it through sed, again, to re-escape the brackets.