The characters "[" and "]" together are used to denote a character class in regular expressions. The effect is that you're trying to match "exit code 0".
Alter your regex by escaping either the first, or both, of the "[" and "]" characters.
Here's an example:
'exit code [0]','exit code 0' |
ForEach-Object{
if ($_ -match 'exit code [0]'){Write-Host "'exit code [0]' matched '$_'"}
if ($_ -match 'exit code \[0]'){Write "'exit code \[0]' matched '$_'"}
# if ($_ -match 'exit code [0\]'){Write "'exit code [0\]' matched '$_'"} ## THIS WILL FAIL!!!!
if ($_ -match 'exit code \[0\]'){Write "'exit code \[0\]' matched '$_'"}
}
If you escape only the "]" you'll get an error for having an "unterminated [] set"