OxL Reference

method Regex.matches

True when the whole of s matches the pattern.

Example:

oxl✓ checked in CI
fn main() io {
  let re = Regex.compile("[0-9]+")!
  print("{re.matches("123")} {re.matches("12a")}")
}
Output
true false
pub(api) fn matches(s: str) -> bool

Since. 1.0.0-beta

Parameters

NameType
sstr

Returns

bool

Effects

none declared (pure unless the body says otherwise)

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

See also