While parsing a string:
1815 ((sd-pam)) S 1778 1778 1778 ...
I am trying to omit the "((sd-pam))" token
I used the following:
omit_string %= lexeme['(' >> +(char_ - ')') >> ')'];
then I would use it in the following way below:
start %=
int_
>> omit[omit_string >> char_ >> repeat(10)[long_]]
>> long_ >> long_ >> long_ >> long_
;
This works with a single bracket at the end (ex. "((sd-pam)" ), but does not work with more than one at the ned. I can't seem to find any doc on the relevant syntax to figure out how I can achieve the desired result.
It all depends on your actual grammar.
Your samples are not enough to specify what you want. To parse the sample you would simply adjust the rule:
To also support
(sd-pam):See it Live On Coliru
UPDATE
To the updated requirements in the comments suggested some improving solutions including:
And finally
Which passes all of the edge test cases:
See it Live On Coliru
Printing