Rule with optional suffix, suffix must end in a specific character #742
-
I am currently trying to encode the following rule using pest (an extremely simplified version of this):
My pest rule looks as follows:
My expectation is that
Have I encountered a bug, or is there a specific reason this rule is not working as I am expecting? I thank you very much for this fantastic crate and the hard work you put into it! :-) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I think the problem here is that matching is greedy and does not backtrack. I.e. all the I think this rule should work instead:
|
Beta Was this translation helpful? Give feedback.
I think the problem here is that matching is greedy and does not backtrack. I.e. all the
est
are consumed in the(ASCII_ALPHANUMERIC|".")*
part and there is nothing left for the finalASCII_ALPHANUMERIC
. Therefore, the whole(...)?
part fails.I think this rule should work instead: