Documentation

RegexCorrectness.Data.Expr.Semantics.CaptureGroups

Groups captured by a regex match.

  • For .group tag first last rest, the group with tag tag starts at position first and ends at position last. It will overwrite the positions with the same tag in rest.
  • .concat g₁ g₂ joins the capture groups for concatenations by preferring the groups in g₂ over g₁. (Last write wins.)
Instances For
    Equations
    Instances For
      @[simp]
      theorem Regex.Data.CaptureGroups.mem_group {group : Nat × String.Pos × String.Pos} {tag : Nat} {first last : String.Pos} {rest : CaptureGroups} :
      group Regex.Data.CaptureGroups.group tag first last rest group = (tag, first, last) group rest
      @[simp]
      theorem Regex.Data.CaptureGroups.mem_concat {group : Nat × String.Pos × String.Pos} {g₁ g₂ : CaptureGroups} :
      group g₁.concat g₂ group g₁ group g₂