I have looked at the documentation that PHP provides on PCRE Patterns. I am using a third party plugin to handle some text from the user, and the following preg_replace is failing because of missing terminating ] char. (preg_replace(): Compilation failed: missing terminating ] for character class
$input = preg_replace('/[\]/i','',$userInput);
From what I can see the terminating delimiter is / with a character class that only has a \ in it. The i, if I can read correctly tells the expression to not care about upper or lower case. I see both opening [ and closing ].
Why is it throwing the error? What is the preg_replace trying to do?