API Reference
Classes 
Regex 
- Implements: ILiftable
Represents a compiled regular expression pattern.
Methods 
| Name | Description | 
|---|---|
|  | Finds the first occurrence of the pattern within the text. | 
|  | Finds all non-overlapping occurrences of the pattern within the text. | 
|  | Finds the start and end index of all matches within the text. | 
|  | Finds the start and end index of the first match within the text. | 
|  | Finds the first match and its submatches. | 
|  | Finds the start and end index of the match and all submatches. | 
|  | Replaces all occurrences of the match with a replacement string. | 
|  | Checks if the regular expression matches the provided text. | 
find 
find(text: str): str?
Finds the first occurrence of the pattern within the text.
textRequired 
- Type: str
The text to search within.
findAll 
findAll(text: str): MutArray<str>
Finds all non-overlapping occurrences of the pattern within the text.
Returns an empty array if no matches are found.
textRequired 
- Type: str
The text to search within.
findAllIndex 
findAllIndex(text: str): MutArray<MutArray<num>>
Finds the start and end index of all matches within the text.
Indices are zero-based.
textRequired 
- Type: str
The text to search within.
findIndex 
findIndex(text: str): MutArray<num>?
Finds the start and end index of the first match within the text.
textRequired 
- Type: str
The text to search within.
findSubmatch 
findSubmatch(text: str): MutArray<str>?
Finds the first match and its submatches.
textRequired 
- Type: str
The text to search within.
findSubmatchIndex 
findSubmatchIndex(text: str): MutArray<MutArray<num>>?
Finds the start and end index of the match and all submatches.
textRequired 
- Type: str
The text to search within.
replaceAll 
replaceAll(text: str, replacement: str): str
Replaces all occurrences of the match with a replacement string.
textRequired 
- Type: str
The text to search and replace within.
replacementRequired 
- Type: str
The replacement string.
test 
test(text: str): bool
Checks if the regular expression matches the provided text.
textRequired 
- Type: str
The text to check against.
Static Functions 
| Name | Description | 
|---|---|
|  | Compiles the provided regex pattern into a Regexobject. | 
compile 
regex.compile(pattern: str);
Compiles the provided regex pattern into a Regex object.
patternRequired 
- Type: str
The regex pattern to compile.