Excluding a factor that is not a character set

Several times I have wanted a factor in a rule to be the exclusion of another named rule. A recent example is:

song: ~code, code, line-ending .
@code: -" ", [Lu], [Lu], digit, digit, digit, digit, digit, digit .
-digit: ["0"-"9"] .

Where, above, "~code" is what I would like to be able to write; intending to represent everything prior to a substring that matches the code rule.

In the spec I only see information about how to exclude a character set. Is there also a way to exclude a pattern of characters, as defined by a named rule?

Sheila

Received on Tuesday, 7 October 2025 23:57:26 UTC