method Regex.compile
Compiles at run time; prefer the literal re"…", which is checked when the program is built.
Example:
fn main() io {
let re = Regex.compile("[a-z]+")!
print("{re.matches("abc")}")
}Output
true
pub(api) static fn compile(pattern: str) -> Regex | ParseErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
pattern | str |
Returns
Errors
ParseError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:1247