OxL Reference

method Regex.find

The first match.

Example:

oxl✓ checked in CI
fn main() io {
  let re = Regex.compile("[0-9]+")!
  print("{re.find("ab12cd")!.text}")
}
Output
12
pub(api) fn find(s: str) -> Match?

Since. 1.0.0-beta

Parameters

NameType
sstr

Returns

Match?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:1294

See also