I was trying to split a string using a regex today and i had this problem my string of format A | B | C My intent was to split this string using the Regex match for “|” The regex that worked for me was “\|” - escaping pipe and then escaping the slash the escapes the pipe