If anyone is still looking for how to do this, you can read this:
\0dd character with octal code 0dd
\ddd character with octal code ddd, or back reference
\o{ddd..} character with octal code ddd..
\xhh character with hex code hh
\x{hhh..} character with hex code hhh.. (non-JavaScript mode)
\uhhhh character with hex code hhhh (JavaScript mode only)
(4) \u matches a lower case "u" character unless it is followed by four
hexadecimal digits, in which case the hexadecimal number defines the
code point to match. By default, \u causes a compile time error (Perl
uses it to upper case the following character).
That means you can do this to escape the | character:
\x{7C}
or
\u007C
0x7C is the hex byte that represents the | character.
0x5C is the one for \ (if you need it).
You can use any hex editor to find the hex value for a character.
More details:
Constraints on character values
Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so-
called "surrogate" codepoints), and 0xffef.