-
Describe the bugI can't seem to match either '{' or '[' using the parser integrated in the pest website. To ReproduceClick here to try it out. Grammar
Text to match
Output
ScreenshotExtraI've also tried with: Expected behaviorClearly, it should be able to match the given string... right? |
Beta Was this translation helpful? Give feedback.
Answered by
tomtau
Mar 12, 2024
Replies: 1 comment 5 replies
-
PEGs are eager: https://pest.rs/book/grammars/peg.html#eagerness You can try
or you can define your own rule of allowed characters that can be inside brackets |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
tomtau
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PEGs are eager: https://pest.rs/book/grammars/peg.html#eagerness
so
ASCII*
will also match]
, and the whole expression will fail to match.You can try
ASCII_ALPHANUMERIC
(https://pest.rs/book/grammars/built-ins.html#ascii-rules) instead:or you can define your own rule of allowed characters that can be inside brackets