Using Boost Spirit to parse a text file while skipping large parts of it
问题 I have the following std::string : <lots of text not including "label A" or "label B"> label A: 34 <lots of text not including "label A" or "label B"> label B: 45 <lots of text not including "label A" or "label B"> ... I want extract single integral numbers following all occurrences of label A or label B and place them in corresponding vector<int> a, b . A simple, but not elegant way of doing it is using find("label A") and find("label B") and parsing whichever is first. Is there a succinct