Skip to content

Pattern

xtay2 edited this page Feb 20, 2023 · 2 revisions

Introduction

The Pattern is a terminal that matches any pre-specified regex. It gets used primarily for identifiers.

Constructors

  • Section(String regex): Creates a rule from a regex.

Examples

new Pattern("[a-zA-Z_]+");

Matches

"hello_world"
"HelloWorld"
"HELLO_WORLD"
"___"

Fails

""
"Hello-World"

Clone this wiki locally