in reply to Re: Lexing: how to define tokens based on "context"
in thread Lexing: how to define tokens based on "context"

Since the rule name can be any alphanumeric string including _ a simple "\w+" won't suffice.

I should think something like [\w\_]+ would work:

\w already matches underscore.

Dave.

Replies are listed 'Best First'.
Re^3: Lexing: how to define tokens based on "context"
by marinersk (Priest) on Oct 16, 2013 at 16:56 UTC
    D'oh!

    /meslinks off to the closest dark corner to try to hide.

    :-)