I have a text "ON something blah blah blah could be anything"
I want to match the ON, something, and "blah blah blah could be anything"
I have my tokens as
ON : ('O'|'o')('N'|'n');
INDEX: (options {greedy=false;}: ESC | .)*
WS :
( ' '
| '\t'
| '\r'
| '\n'
)+
{ $channel=HIDDEN; }
;
ESC :
'\\' ('"'|'\''|'\\')
;
and I normally want whitespace to be thrown away so channel is hidden but in this case, I want to match the rest of the string WITH whitespace. how do I do this in a rule? Something like
myRule: ON INDEX REST;
but not sure what REST should be? (and not sure if I need imaginary token or not).
thanks, Dean