logos.std.lang.text.regex

Module std · package logos-std

Types

structRegex

struct Regex

Compiled regex pattern: a raw (pointer, length) view into the pattern bytes. Does not own the bytes — the str passed to compile must outlive this Regex.

Fields

pat: *const u8
plen: i64

Functions

fncompile

fn compile(p: &[u8]) -> Regex

Compiles pattern p into a Regex that borrows p’s bytes; p must outlive it.

fnfind

fn find(re: &Regex, s: &[u8]) -> i64

Returns the byte index of the first match in s, or -1 if none.

fnis_match

fn is_match(re: &Regex, s: &[u8]) -> bool

Returns true if re matches anywhere in s; ^ anchors to start, $ to end.