-
|
I'm having some trouble parsing strings of the following type: The string definition (in the manual I'm following) is given as (definitions below)
I can match the entire string easily, but am unable to figure out how to match everything inside the leading semicolon, and trailing eol & semicolon. I have interpreted the text inside the ';'s as:
I can match the entire string with The first leaves the leading and trailing ';' in the textstring match. The second uses the Doing
results in an infinite loop. I would like to be able to match the string inside the semicolons, and without the trailing eol. I think there is some subtlety of a negative lookahead that I am missing. I've tried various incarnations of not_at, not_at<end_sep>, and others, and am starting to go around in circles. What am I not seeing? Thanks Matthew |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
You might try something like: struct textcontent : pegtl::until<at<end_sep>> {};
struct textstring : pegtl::if_must<sep, textcontent, end_sep> {};Add the action to |
Beta Was this translation helpful? Give feedback.
You might try something like:
Add the action to
textcontentand it will not contain the surrounding separators.