I need to be able to match a certain string ('[' then any number of equals signs or none then '['
), then i need to match a matching close bracket (']' then the same number of equals signs then ']'
) after some other match rules. ((options{greedy=false;}:.)*
if you must know). I have no clue how to do this in ANTLR, how can i do it?
An example: I need to match [===[whatever arbitrary text ]===]
but not [===[whatever arbitrary text ]==]
.
I need to do it for an arbitrary number of equals signs as well, so therein lies the problem: how do i get it to match an equal number of equals signs in the open as in the close? The supplied parser rules so far dont seem to make sense as far as helping.