Module
Module documentation.
moduleregexp
Classes
Classes and inheritance.
classregexp::Regexp
@brief`Regexp` type.
@details`Regexp` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Regexp {
/*
@brief `pat` field.Functions
Free functions and class methods.
functionregexp::__regexp_simple_match_plus
Signature
extern func __regexp_simple_match_plus(pat: String, s: String, anchored: Int) -> Int;extern func __regexp_simple_match_plus(pat: String, s: String, anchored: Int) -> Int;
/*@briefBinds the low-level runtime symbol `__regexp_simple_match_plus`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- patPattern string used for matching keys, text, routes, or protocol fields.
- sInput string.
- anchoredWhether matching must be anchored at the start position.
@returnReturns the operation result as `Int`.
functionregexp::Regexp.init
Signature
func init(self: regexp.Regexp, pat: String) -> Void func init(self: regexp.Regexp, pat: String) -> Void {
self.pat = pat;
self.valid = true;@briefInitializes a `Regexp` instance.
@detailsEstablishes the initial field state for `Regexp` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- patPattern string used for matching keys, text, routes, or protocol fields.
@returnVoid
functionregexp::Regexp.deinit
Signature
func deinit(self: regexp.Regexp) -> Void func deinit(self: regexp.Regexp) -> Void {
_ = self.ops.free();
_ = self.outs.free();@briefReleases fallback resources at the end of the `Regexp` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionregexp::Regexp.match_string
Signature
func match_string(self: regexp.Regexp, s: String) -> Bool func match_string(self: regexp.Regexp, s: String) -> Bool {
if !self.valid {
return false;@briefProvides the system library operation `Regexp.match_string`.
@detailsExecutes the `match_string` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- sInput string.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionregexp::Regexp._index_pair
Signature
func _index_pair(self: regexp.Regexp, start: Int, end: Int) -> collections.Vector<Int> func _index_pair(self: regexp.Regexp, start: Int, end: Int) -> collections.Vector<Int> {
let out: collections.Vector<Int> = new collections.Vector<Int>();
_ = out.push(start);@briefProvides the system library operation `Regexp._index_pair`.
@detailsExecutes the `_index_pair` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- startZero-based starting index, byte offset, or range boundary for the operation.
- endEnd index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::Regexp._not_found_index
Signature
func _not_found_index(self: regexp.Regexp) -> collections.Vector<Int> func _not_found_index(self: regexp.Regexp) -> collections.Vector<Int> {
return self._index_pair(-1, -1);
}@briefProvides the system library operation `Regexp._not_found_index`.
@detailsExecutes the `_not_found_index` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::Regexp.find_string_index
Signature
func find_string_index(self: regexp.Regexp, s: String) -> collections.Vector<Int> func find_string_index(self: regexp.Regexp, s: String) -> collections.Vector<Int> {
if !self.valid {
return self._not_found_index();@briefFinds a matching position or element with `Regexp.find_string_index`.
@detailsExecutes the `find_string_index` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- sInput string.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::Regexp.find_string
Signature
func find_string(self: regexp.Regexp, s: String) -> String func find_string(self: regexp.Regexp, s: String) -> String {
let r: collections.Vector<Int> = self.find_string_index(s);
let a: Int = r.get(0);@briefFinds a matching position or element with `Regexp.find_string`.
@detailsExecutes the `find_string` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- sInput string.
@returnReturns the operation result as `String`.
functionregexp::Regexp.replace_all_string
Signature
func replace_all_string(self: regexp.Regexp, s: String, repl: String) -> String func replace_all_string(self: regexp.Regexp, s: String, repl: String) -> String {
if !self.valid {
return s;@briefProvides the system library operation `Regexp.replace_all_string`.
@detailsExecutes the `replace_all_string` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- sInput string.
- replReplacement text inserted when a match or placeholder is found.
@returnReturns the operation result as `String`.
functionregexp::Regexp._expand_range_in
Signature
func _expand_range_in(self: regexp.Regexp, alphabet: String, a: String, b: String) -> String func _expand_range_in(self: regexp.Regexp, alphabet: String, a: String, b: String) -> String {
let start_index: Int = strings.find_substr(alphabet, a);
let end_index: Int = strings.find_substr(alphabet, b);@briefProvides the system library operation `Regexp._expand_range_in`.
@detailsExecutes the `_expand_range_in` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- alphabetAlphabet string used by the encoder or decoder.
- aInput value used for comparison, computation, or conversion.
- bInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `String`.
functionregexp::Regexp._expand_range
Signature
func _expand_range(self: regexp.Regexp, a: String, b: String) -> String func _expand_range(self: regexp.Regexp, a: String, b: String) -> String {
let expanded: String = self._expand_range_in("0123456789", a, b);
if std.len(expanded) > 0 {@briefProvides the system library operation `Regexp._expand_range`.
@detailsExecutes the `_expand_range` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
- bInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `String`.
functionregexp::Regexp._state
Signature
func _state(self: regexp.Regexp, op: Int, out: Int, out1: Int, arg: Int, lit: String) -> Int func _state(self: regexp.Regexp, op: Int, out: Int, out1: Int, arg: Int, lit: String) -> Int {
let idx: Int = self.ops.len();
_ = self.ops.push(op);@briefProvides the system library operation `Regexp._state`.
@detailsExecutes the `_state` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- opOperation code or operation name selected by the caller.
- outOutput buffer, vector, pointer, or destination that receives produced data.
- out1First output value or output buffer populated by the operation.
- argOpaque argument value passed through to a callback, thread entry point, or runtime helper.
- litLiteral string or literal token processed by the parser.
@returnReturns the operation result as `Int`.
functionregexp::Regexp._list1
Signature
func _list1(self: regexp.Regexp, p: Int) -> collections.Vector<Int> func _list1(self: regexp.Regexp, p: Int) -> collections.Vector<Int> {
let v: collections.Vector<Int> = new collections.Vector<Int>();
_ = v.push(p);@briefProvides the system library operation `Regexp._list1`.
@detailsExecutes the `_list1` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- pNative pointer address passed to the runtime binding.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::Regexp._append
Signature
func _append(self: regexp.Regexp, a: collections.Vector<Int>, b: collections.Vector<Int>) -> collections.Vector<Int> func _append(self: regexp.Regexp, a: collections.Vector<Int>, b: collections.Vector<Int>) -> collections.Vector<Int> {
let out: collections.Vector<Int> = new collections.Vector<Int>();
loop (let left_index: Int = 0; left_index < a.len(); left_index += 1) {@briefProvides the system library operation `Regexp._append`.
@detailsExecutes the `_append` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
- bInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::Regexp._patch
Signature
func _patch(self: regexp.Regexp, l: collections.Vector<Int>, target: Int) -> Void func _patch(self: regexp.Regexp, l: collections.Vector<Int>, target: Int) -> Void {
loop (let i: Int = 0; i < l.len(); i += 1) {
let p: Int = l.get(i);@briefProvides the system library operation `Regexp._patch`.
@detailsExecutes the `_patch` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- lList, length, left operand, or line value consumed by the operation.
- targetTarget value, path, resource, or address affected by the operation.
@returnVoid
functionregexp::Regexp._epsilon
Signature
func _epsilon(self: regexp.Regexp) -> regexp.Frag func _epsilon(self: regexp.Regexp) -> regexp.Frag {
let j: Int = self._state(5, -1, -1, 0, "");
return new regexp.Frag(j, self._list1(j * 2));@briefProvides the system library operation `Regexp._epsilon`.
@detailsExecutes the `_epsilon` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._char
Signature
func _char(self: regexp.Regexp, c: String) -> regexp.Frag func _char(self: regexp.Regexp, c: String) -> regexp.Frag {
let s: Int = self._state(1, -1, -1, 0, c);
return new regexp.Frag(s, self._list1(s * 2));@briefProvides the system library operation `Regexp._char`.
@detailsExecutes the `_char` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- cCharacter, byte, connection, or container value consumed by the operation.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._any
Signature
func _any(self: regexp.Regexp) -> regexp.Frag func _any(self: regexp.Regexp) -> regexp.Frag {
let s: Int = self._state(2, -1, -1, 0, "");
return new regexp.Frag(s, self._list1(s * 2));@briefProvides the system library operation `Regexp._any`.
@detailsExecutes the `_any` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._match
Signature
func _match(self: regexp.Regexp) -> Int func _match(self: regexp.Regexp) -> Int {
return self._state(3, -1, -1, 0, "");
}@briefProvides the system library operation `Regexp._match`.
@detailsExecutes the `_match` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `Int`.
functionregexp::Regexp._split
Signature
func _split(self: regexp.Regexp, out: Int, out1: Int) -> Int func _split(self: regexp.Regexp, out: Int, out1: Int) -> Int {
return self._state(4, out, out1, 0, "");
}@briefProvides the system library operation `Regexp._split`.
@detailsExecutes the `_split` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- outOutput buffer, vector, pointer, or destination that receives produced data.
- out1First output value or output buffer populated by the operation.
@returnReturns the operation result as `Int`.
functionregexp::Regexp._eol
Signature
func _eol(self: regexp.Regexp) -> regexp.Frag func _eol(self: regexp.Regexp) -> regexp.Frag {
let s: Int = self._state(7, -1, -1, 0, "");
return new regexp.Frag(s, self._list1(s * 2));@briefProvides the system library operation `Regexp._eol`.
@detailsExecutes the `_eol` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._class
Signature
func _class(self: regexp.Regexp, allowed: String, neg: Bool) -> regexp.Frag func _class(self: regexp.Regexp, allowed: String, neg: Bool) -> regexp.Frag {
let idx: Int = self.class_allowed.len();
_ = self.class_allowed.push(allowed);@briefProvides the system library operation `Regexp._class`.
@detailsExecutes the `_class` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- allowedAllowed value set or boolean permission flag used for validation.
- negWhether the numeric value or match result should be negated.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._concat
Signature
func _concat(self: regexp.Regexp, a: regexp.Frag, b: regexp.Frag) -> regexp.Frag func _concat(self: regexp.Regexp, a: regexp.Frag, b: regexp.Frag) -> regexp.Frag {
let a_outs: collections.Vector<Int> = a.outs_vec();
let b_outs: collections.Vector<Int> = b.outs_vec();@briefProvides the system library operation `Regexp._concat`.
@detailsExecutes the `_concat` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
- bInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._alt
Signature
func _alt(self: regexp.Regexp, a: regexp.Frag, b: regexp.Frag) -> regexp.Frag func _alt(self: regexp.Regexp, a: regexp.Frag, b: regexp.Frag) -> regexp.Frag {
let s: Int = self._split(a.start, b.start);
let outs: collections.Vector<Int> = self._append(a.outs_vec(), b.outs_vec());@briefProvides the system library operation `Regexp._alt`.
@detailsExecutes the `_alt` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
- bInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._star
Signature
func _star(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag func _star(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag {
let s: Int = self._split(a.start, -1);
let a_outs: collections.Vector<Int> = a.outs_vec();@briefProvides the system library operation `Regexp._star`.
@detailsExecutes the `_star` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._plus
Signature
func _plus(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag func _plus(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag {
let s: Int = self._split(a.start, -1);
let a_outs: collections.Vector<Int> = a.outs_vec();@briefProvides the system library operation `Regexp._plus`.
@detailsExecutes the `_plus` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._quest
Signature
func _quest(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag func _quest(self: regexp.Regexp, a: regexp.Frag) -> regexp.Frag {
let s: Int = self._split(a.start, -1);
let outs: collections.Vector<Int> = self._append(a.outs_vec(), self._list1(s * 2 + 1));@briefProvides the system library operation `Regexp._quest`.
@detailsExecutes the `_quest` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- aInput value used for comparison, computation, or conversion.
@returnReturns the operation result as `regexp.Frag`.
functionregexp::Regexp._compile
Signature
func _compile(self: regexp.Regexp) -> Void func _compile(self: regexp.Regexp) -> Void {
let compile_pattern: String = self.pat;
if (std.len(compile_pattern) > 0) && (std.substr(compile_pattern, 0, 1) == "^") {@briefProvides the system library operation `Regexp._compile`.
@detailsExecutes the `_compile` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionregexp::Regexp._class_match
Signature
func _class_match(self: regexp.Regexp, cls: Int, ch: String) -> Bool func _class_match(self: regexp.Regexp, cls: Int, ch: String) -> Bool {
if cls < 0 || cls >= self.class_allowed.len() {
return false;@briefProvides the system library operation `Regexp._class_match`.
@detailsExecutes the `_class_match` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- clsClass object or class descriptor used by reflection or dispatch.
- chCharacter code or channel handle processed by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionregexp::Regexp._add_state
Signature
func _add_state(self: regexp.Regexp, lst: collections.Vector<Int>, mark: collections.Vector<Int>, list_id: Int, s: Int, pos: Int, n: Int) -> Void func _add_state(self: regexp.Regexp, lst: collections.Vector<Int>, mark: collections.Vector<Int>, list_id: Int, s: Int, pos: Int, n: Int) -> Void {
if s < 0 || mark.get(s) == list_id {
return;@briefProvides the system library operation `Regexp._add_state`.
@detailsExecutes the `_add_state` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- lstList instance or list handle whose elements are read or modified.
- markMarker value or position recorded by the parser or collection.
- list_idList identifier used to select a native or protocol list.
- sInput string.
- posPosition index or cursor location used by the operation.
- nCount, size, or limit value.
@returnVoid
functionregexp::Regexp._list_has_match
Signature
func _list_has_match(self: regexp.Regexp, lst: collections.Vector<Int>) -> Bool func _list_has_match(self: regexp.Regexp, lst: collections.Vector<Int>) -> Bool {
loop (let i: Int = 0; i < lst.len(); i += 1) {
if self.ops.get(lst.get(i)) == 3 {@briefProvides the system library operation `Regexp._list_has_match`.
@detailsExecutes the `_list_has_match` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- lstList instance or list handle whose elements are read or modified.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionregexp::Regexp._match_from
Signature
func _match_from(self: regexp.Regexp, s: String, start_pos: Int) -> Int func _match_from(self: regexp.Regexp, s: String, start_pos: Int) -> Int {
let n: Int = std.len(s);
if self.start < 0 || start_pos < 0 || start_pos > n {@briefProvides the system library operation `Regexp._match_from`.
@detailsExecutes the `_match_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- sInput string.
- start_posStarting position index used when scanning or matching input.
@returnReturns the operation result as `Int`.
functionregexp::compile
Signature
func compile(pat: String) -> regexp.Regexpfunc compile(pat: String) -> regexp.Regexp {
return new regexp.Regexp(pat);
}@briefProvides the system library operation `compile`.
@detailsExecutes the `compile` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `regexp.Regexp`.
functionregexp::find_string_index
Signature
func find_string_index(re: regexp.Regexp, s: String) -> collections.Vector<Int>func find_string_index(re: regexp.Regexp, s: String) -> collections.Vector<Int> {
return re.find_string_index(s);
}@briefFinds a matching position or element with `find_string_index`.
@detailsExecutes the `find_string_index` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- reRegular expression object or pattern used for matching text.
- sInput string.
@returnReturns the operation result as `collections.Vector<Int>`.
functionregexp::replace_all_string
Signature
func replace_all_string(re: regexp.Regexp, s: String, repl: String) -> Stringfunc replace_all_string(re: regexp.Regexp, s: String, repl: String) -> String {
return re.replace_all_string(s, repl);
}@briefProvides the system library operation `replace_all_string`.
@detailsExecutes the `replace_all_string` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- reRegular expression object or pattern used for matching text.
- sInput string.
- replReplacement text inserted when a match or placeholder is found.
@returnReturns the operation result as `String`.
Variables
Class fields (var).
varregexp::Regexp.pat
Type
String@brief`pat` field.
@detailsHolds the `pat` value for each `Regexp` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var pat: String;
/*
@brief `i` field.varregexp::Regexp.valid
Type
Bool@brief`valid` field.
@detailsHolds the `valid` value for each `Regexp` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var valid: Bool;
/*
@brief `anchored` field.varregexp::Regexp.anchored
Type
Bool@brief`anchored` field.
@detailsHolds the `anchored` value for each `Regexp` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var anchored: Bool;
/*
@brief `start` field.varregexp::Regexp.start
Type
Int@brief`start` field.
@detailsHolds the `start` value for each `Regexp` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var start: Int;
/*
@brief `outs` field.varregexp::Regexp.ops
Type
collections.Vector<Int>@brief`ops` field.
@detailsHolds the `ops` value for each `Regexp` instance. The field type is `collections.Vector<Int>`, and constructors and methods keep it synchronized with the object's runtime state.
var ops: collections.Vector<Int>;
/*
@brief `outs` field.varregexp::Regexp.outs
Type
collections.Vector<Int>@brief`outs` field.
@detailsHolds the `outs` value for each `Regexp` instance. The field type is `collections.Vector<Int>`, and constructors and methods keep it synchronized with the object's runtime state.
var outs: Any;
/*varregexp::Regexp.outs1
Type
collections.Vector<Int>@brief`outs1` field.
@detailsHolds the `outs1` value for each `Regexp` instance. The field type is `collections.Vector<Int>`, and constructors and methods keep it synchronized with the object's runtime state.
var outs1: collections.Vector<Int>;
/*
@brief `args` field.varregexp::Regexp.args
Type
collections.Vector<Int>@brief`args` field.
@detailsHolds the `args` value for each `Regexp` instance. The field type is `collections.Vector<Int>`, and constructors and methods keep it synchronized with the object's runtime state.
var args: collections.Vector<Int>;
/*
@brief `lits` field.varregexp::Regexp.lits
Type
collections.Vector<String>@brief`lits` field.
@detailsHolds the `lits` value for each `Regexp` instance. The field type is `collections.Vector<String>`, and constructors and methods keep it synchronized with the object's runtime state.
var lits: collections.Vector<String>;
/*
@brief `class_allowed` field.varregexp::Regexp.class_allowed
Type
collections.Vector<String>@brief`class_allowed` field.
@detailsHolds the `class_allowed` value for each `Regexp` instance. The field type is `collections.Vector<String>`, and constructors and methods keep it synchronized with the object's runtime state.
var class_allowed: collections.Vector<String>;
/*
@brief `class_neg` field.varregexp::Regexp.class_neg
Type
collections.Vector<Int>@brief`class_neg` field.
@detailsHolds the `class_neg` value for each `Regexp` instance. The field type is `collections.Vector<Int>`, and constructors and methods keep it synchronized with the object's runtime state.
var class_neg: collections.Vector<Int>;
/*