Consider the following rule
<rule: str>
( <[token1]> | <[token2]> ) +
the output (%/
) will be the same for the following inputs
input1: <token1> <token2> <token1>
input2: <token1> <token1> <token2>
This is because the 2nd is appended to the first one within a list named 'token1' but there is no hint on the order of matching with respect to other tokens.
Any idea how to get the matching order saved into %/
?
p.s. I have problems compiling my scripts with this %/ magical variable. It always gives me an error on the line following the use of %/
. I assume that the compiler considers it as a beginning of regex without terminating /... Please let me know if I am using it correctly.
You do it by turning
<str>
into<[str]>
so you endup with array in$/->{str}
like this