Skip to Content

Regular expression"\\|" in strsplit

>str= "AAC|Australia Acquisition Corp. - Ordinary Shares|S|N|D|100"
> strsplit(str,"\\|")
[[1]]
[1] "AAC"                                          
[2] "Australia Acquisition Corp. - Ordinary Shares"
[3] "S"                                            
[4] "N"                                            
[5] "D"                                            
[6] "100"   

I wonder \\| is equal to | ?

maybe \\|is equal to \| ,

why can strsplit(str,"\\|") work?