Creates a token matcher regex with a descriptive name for error messages. Automatically adds the sticky (/y) flag if not present.
This is the recommended way to create regex patterns for use with s.read(), s.accept(), s.peek(), and related methods in plugins.
s.read()
s.accept()
s.peek()
The regular expression pattern to match tokens
A descriptive name shown in error messages (e.g., "identifier", "number")
A new RegExp with the sticky flag and custom toString()
Creates a token matcher regex with a descriptive name for error messages. Automatically adds the sticky (/y) flag if not present.
This is the recommended way to create regex patterns for use with
s.read(),s.accept(),s.peek(), and related methods in plugins.