class · System.Text
Regex
public class System.Text.Regex : System.Any
A compiled pattern.
- Tipo
- class
- Espacio de nombres
- System.Text
- Ensamblado
- System.Core
- Acceso
- public, final
- Archivo fuente
Regex.ant
Herencia
- Clases base
-
AnyRegex
Constructores
constructor Regex(pattern: System.String<u8>)
#
Propiedades
property Pattern: System.String<u8>
#
Métodos
method IsMatch(input: System.String<u8>) -> bool
#
Whether the pattern matches somewhere in input.
static method IsMatch(input: System.String<u8>, pattern: System.String<u8>) -> bool
#
method Match(input: System.String<u8>) -> System.Text.Match
#
The first match in input (Success false when there is none).
method Match(input: System.String<u8>, from: i32) -> System.Text.Match
#
The first match in input at or after from.
method Matches(input: System.String<u8>) -> System.List<System.Text.Match>
#
Every match in input, left to right (an empty match moves on by one unit).
method Replace(input: System.String<u8>, replacement: System.String<u8>) -> System.String<u8>
#
input with every match replaced by replacement ($1…$9 in it stand for the groups, $0 for the match).
Miembros privados e internos (27)
field root: System.Text.RegexNode
#
field pattern: System.String<u8>
#
static method Scan(node: System.Text.RegexNode, table: u8[]) -> bool
#
Whether a node can match without taking a unit; the units it can start with are added to table.
method Link(node: System.Text.RegexNode, next: System.Text.RegexNode) -> System.Text.RegexNode
#
Links a parsed node to what follows it (next): its entry, the node matching starts it with.
method Run(start: System.Text.RegexNode, at: i32) -> i32
#
method Branch(node: System.Text.RegexNode, pos: i32) -> i32
#
The nodes that may try more than one way on: the end, alternatives, groups and repeats.
method Takes(atom: System.Text.RegexNode, at: i32) -> bool
#
Whether a single-unit atom (a literal, a class or .) takes the unit at at.
method RunUnits(node: System.Text.RegexNode, pos: i32) -> i32
#
A repeat of a single-unit atom, as a loop over the run of units it takes rather than a call per unit (a long text would exhaust the stack): greedy takes the longest run and backs off one unit at a time while the rest fails (only to where the next literal is, when a literal follows); lazy starts from the minimum and takes one more unit at a time.
A repeat of more than one unit at pos: count iterations are done; last is where the last one started
(-1 at first).
method Again(node: System.Text.RegexNode, pos: i32, count: i32) -> i32
#
One more iteration of a repeat from pos, after count (put back when it fails).
The first match from from on: its start (-1 when none); its end in matchEnd.
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
Regex en Larva HIR, descompilado a partir de su Larva HIR.
// A compiled pattern.
public class System.Text.Regex : System.Any
{
field root: System.Text.RegexNode
field groups: i32
field pattern: System.String<u8>
field first: u8[]
field prefilter: bool
field anchored: bool
field repeats: i32
field counts: i32[]
field iterationStarts: i32[]
field memoizable: bool
field tails: i32
field failed: u64[]
field failedText: u8[]
field remember: bool
field s: u8[]
field starts: i32[]
field ends: i32[]
field matchEnd: i32
// Whether a node can match without taking a unit; the units it can start with are added to `table`.
static method Scan(node: System.Text.RegexNode, table: u8[]) -> bool
// Links a parsed node to what follows it (`next`): its entry, the node matching starts it with.
method Link(node: System.Text.RegexNode, next: System.Text.RegexNode) -> System.Text.RegexNode
method Run(start: System.Text.RegexNode, at: i32) -> i32
// The nodes that may try more than one way on: the end, alternatives, groups and repeats.
method Branch(node: System.Text.RegexNode, pos: i32) -> i32
// Whether a single-unit atom (a literal, a class or `.`) takes the unit at `at`.
method Takes(atom: System.Text.RegexNode, at: i32) -> bool
// A repeat of a single-unit atom, as a loop over the run of units it takes rather than a call per unit (a
// long text would exhaust the stack): greedy takes the longest run and backs off one unit at a time while
// the rest fails (only to where the next literal is, when a literal follows); lazy starts from the minimum
// and takes one more unit at a time.
method RunUnits(node: System.Text.RegexNode, pos: i32) -> i32
// A repeat of more than one unit at `pos`: `count` iterations are done; `last` is where the last one started
// (-1 at first).
method Iterate(node: System.Text.RegexNode, pos: i32, count: i32, last: i32) -> i32
// One more iteration of a repeat from `pos`, after `count` (put back when it fails).
method Again(node: System.Text.RegexNode, pos: i32, count: i32) -> i32
// The first match from `from` on: its start (-1 when none); its end in matchEnd.
method Search(text: u8[], from: i32) -> i32
constructor Regex(pattern: System.String<u8>)
// Whether the pattern matches somewhere in `input`.
method IsMatch(input: System.String<u8>) -> bool
static method IsMatch(input: System.String<u8>, pattern: System.String<u8>) -> bool
// The first match in `input` (Success false when there is none).
method Match(input: System.String<u8>) -> System.Text.Match
// The first match in `input` at or after `from`.
method Match(input: System.String<u8>, from: i32) -> System.Text.Match
// Every match in `input`, left to right (an empty match moves on by one unit).
method Matches(input: System.String<u8>) -> System.List<System.Text.Match>
// `input` with every match replaced by `replacement` (`$1`…`$9` in it stand for the groups, `$0` for the match).
method Replace(input: System.String<u8>, replacement: System.String<u8>) -> System.String<u8>
property Pattern: System.String<u8>
}