[spirit][qi] How to write a boost::spirit::qi parser to do what '?' does in regex?
Let's say we have a regex "start:(?: ([0-9]{1,2}))? ([0-9].*)".
It will match
std::string string1 = "start: 01 0ab";
and
std::string string2 = "start: 0ab";
We can also get the 2 matched string respectively.
I try to use boost::spirit::qi parser to parse string2 but it couldn't
match.
qi::rule
On 14-10-16 16:25, Han Wang wrote:
I try to use boost::spirit::qi parser to parse string2 but it couldn't match.
Answered on SO https://stackoverflow.com/questions/40043636/how-to-write-a-boostspiritqi-pa...
participants (2)
-
Han Wang
-
Seth