Regex syntax

Regex syntax

Regex syntax

Function

Explains the basic BT regular-expression syntax: create a Regex object with regex(pattern, flags), then call test, match, or replace, or pass it to String.search, String.match, or String.replace.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
patternStringNo''Regular body.
flagsStringNo''Flags string.

Return value

TypeDescription
RegexReturns a Regex object.

Example

Notes

  • Uses Rust regex engine under the hood.
  • A Chinese error will be thrown when regular compilation fails.