Python регулярное выражение выхода из вертикального бара |

^\|[\d|]*

# ^\| matches literal | at start, as | is a Regex token we need to escape it
# [\d|]* matches any number of digits or |, | inside [] is treated literally 
Breakable Bee