Skip to content
Tutorial

Tutorial

From a first scan to the whole pattern language, one short chapter at a time, with the command line, Rust, Python and PowerShell side by side. Read the pages in order:

  1. Getting started - install trex, run a first scan, read its output.
  2. Your first patterns - the token atoms, alternatives, repetition and lenses.
  3. Binding and balance - registers compared later in the match, balanced brackets, and a look-ahead for a literal.
  4. Axes and tools - read an axis, query it from a pattern, and rewrite what a pattern finds.
  5. Beyond regex - anchors, lookaround, the three kinds of choice, atomic groups, symmetry scopes and token classes, then shapes you declare, construct anchors and thresholds read from the stream.