Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

RegexPattern

Swift
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift

View as Markdown

Package
libtmux-swift
Source
Sources/LibTmux/RegexPattern.swift
struct RegexPattern : struct RegexPattern
struct [source]
struct [source]
struct RegexPattern

A compiled regular expression with bounded memory and matching work.

The supported dialect has literals, escaped punctuation, , ^, $, grouping, noncapturing grouping, alternation, *, +, ?, counted repetitions, character classes and ranges, and ASCII \d, \s, and \w shorthands. Lookaround and backreferences are rejected.

Matching consumes Swift extended grapheme clusters. Literal equality uses Swift Character equality, including canonical equivalence. With Options/caseInsensitive, each character is compared through locale-independent lowercased() values; full multi-character case folding is not performed, so ss does not match ß. Dot excludes line terminators.

Swift's own Regex cannot take this job. Its matcher backtracks — on Swift 6.2, (a+)+b against twenty as takes 78 seconds — and a match is synchronous, so the deadline Server/waitForOutput(in:matching:stoppingAt:requiringFreshOutput:startingAt:timeout:tailLimit:) races cannot interrupt one that has started. A pattern here is bounded before it runs, which is also what makes one safe to accept from a client.

15 declared, 1 inherited

Members

Inherited members

Reached through Equatable.!=(_:_:).

  • !=(_:_:) Equatable.!=(_:_:) Returns a Boolean value indicating whether two values are not equal.
Esc

Type to search.