I need to match something like the Perl regexp matcher
m/my regex!*/
where the quotes can be any character from a range. So the above is the same as
m%my regex!*%
A naive guess of a lexer rule would be
REGEX: 'm' quote=. (~(quote))* quote;
but that does not work, because the latter quote
is not referring to the quote=
but to some rule.
I can do it with a lot of own code, like
REGEX: 'm' quote=. { ... implement the loop and final match myself ... } ;
but somehow I think there should be a canonical way to do such things.