OxL Справочник OxL
РусскийEnglish

method Regex.compile

Compiles at run time; prefer the literal re"…", which is checked when the program is built.

Example:

oxl✓ проверяется в CI
fn main() io {
  let re = Regex.compile("[a-z]+")!
  print("{re.matches("abc")}")
}
Вывод
true
pub(api) static fn compile(pattern: str) -> Regex | ParseError

С версии. 1.0.0-beta

Параметры

ИмяТип
patternstr

Возвращает

Regex

Ошибки

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/text.oxl:1247

См. также