"\|" is an illegal escape sequence in R

I have a column with strings that are separated by “|”. When I try to split it. It splits every character. Alternatively, when I try to escape using “|” it gives me an error. ‘"|" is an illegal escape sequence in R.’

Is this expected behavior? To split it should I use regex?

You want to use two backslashes so it would be something like,

\\|

I’ve been meaning to do a webinar on Regular Expression, stay tuned!

Meanwhile, here is a cheat sheet for Regular Expression in R, which is basically the one you need in Exploratory.