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 "!(S&B|H)&!(S&J|R)&!(P)" with the cout line below, I get: "(S&J|R)&!(P)", when I thought it should be: "(S&J|R)". It either is beyond what I have seen or just so simple that I just am not getting it. Any help would help a lot. Thanks.
#include <iostream>
#include <string>
using namespace std;
int main(int argc, const char * argv[]) {
string name = "!(S&B|H)&!(S&J|R)&!(P)";
cout<<name.substr(10,16)<<endl;
return 0;
}//Main