-
Notifications
You must be signed in to change notification settings - Fork 836
Open
Description
I tried to match a format like string like this:
"This is a {{{arg}}} literal". I wanted it to replace the escaped character "{" using map, such that my end result would be:
"This is a {", "arg", "} literal"
Below the code I use to parse the literal, ie. "This is a {{" -> "This is a {"
recognize(many1(alt((
map(tag("{{"), |_| "{"),
map(tag("}}"), |_| "}"),
is_not("{"),
)))).parse(input);The part without recognize would output: ["This is a ", "{"]
Recognize turns it into "This is a {{"
Version: 8
Metadata
Metadata
Assignees
Labels
No labels