4.4 Specifying a lexer pattern - the pattern statement

A pattern statement is used to define a lexer pattern that can execute user code but may not result in a matched token.

Example:

/foo+/ <<
  writeln("saw a foo pattern");
>>

This can be especially useful with Lexer modes.

See also Regular expression syntax.