I want to be able to parse between 2 marks in parse rule. For a contrieved example:
src: {a b c d e f}
rule: [
to "b" mark1: thru "e" mark2:
to mark1 copy text to mark2
]
This doesn't work, text contains "[" instead of what I'd like to get:
b c d e
two alternative solutions/rules working in Red
and
You're trying to implement a "DO desire" of copying using PARSE. PARSE's COPY is looking for patterns, not treating the series as positions.
You can escape into DO in mid-parse via a PAREN!, it will run if the parse rule reaches that point.
That will give you text as
b c d e
Note that you can't have it both ways, either with COPY or with TO.
TO <series!>
meant "look for b", not "jump to the position of b". So when you sayto mark1
you're invoking another match. If you want to set the parse position to the specific position recorded in mark1, use:mark1
in the parse rule.