I am trying to substring some expressions into individual tokens such as !, &, | (), etc. What I am having trouble with is the fact that when I try to make a sub-string of \
I did not understand your question well but if you want to get
(S&J|R)
You should do:
name.substr(10,7)
The second parameter is the length.