Using a pipe character | in submit success/failed

I’m coming across the situation where the text I need to parse to check for a successful submission includes a pipe character, but this is used as a separator in submit success. I’ve tried escaping it with a backslash but that doesn’t seem to work. Is there any other way?