Skip to main content

regex

include "regex";

Regular expressions: compile a pattern once, then find matches and their captured groups in text. Patterns use Ruby syntax and match UTF-8 text.

Types​

regex​

Native object

capture_count infallible​

infallible fn capture_count() -> int

find infallible​

infallible fn find(
string text,
int start,
array<int> starts,
array<int> ends) -> int

close infallible​

infallible fn close()

Functions​

regex_compile​

fn regex_compile(string pattern) -> regex

Compiles pattern. Close the regex when done.