Module regex/index
regex/index
Regular expression engine with an NFA-based virtual machine.
Types
Regex
object
Regex
Compiled regular expression backed by an NFA program.
Fields
| Name | Type | Description |
|---|---|---|
_program | NfaProgram | |
_flags | RegexFlags | |
_pattern | String | |
_n_groups | usize | |
_group_names | <struct:struct_yo_id_62215> |
impl(Regex, ...)
new : (Regex) fn(pattern : String, flags_str : String) -> <enum:enum_yo_id_64716>_extract_substring : (Regex) fn(self : Regex, bytes : <struct:struct_yo_id_3539>, start : usize, end_pos : usize) -> String_byte_to_char_index : (Regex) fn(self : Regex, bytes : <struct:struct_yo_id_3539>, byte_pos : usize) -> usize_find_prefix_pos : (Regex) fn(self : Regex, input_bytes : <struct:struct_yo_id_3539>, from_byte : usize) -> usizeParameters
| Name | Type | Notes |
|---|---|---|
self | Regex | |
input_bytes | <struct:struct_yo_id_3539> | |
from_byte | usize |
Returns: usize
impl(Regex, ...)
_build_match : (Regex) fn(self : Regex, slots : <struct:struct_yo_id_4084>, input : String) -> RegexMatchimpl(Regex, ...)
exec : (Regex) fn(self : Regex, input : String) -> <enum:enum_yo_id_64834>impl(Regex, ...)
test : (Regex) fn(self : Regex, input : String) -> boolimpl(Regex, ...)
_apply_replacement : (Regex) fn(self : Regex, replacement : String, m : RegexMatch) -> Stringimpl(Regex, ...)
replace : (Regex) fn(self : Regex, input : String, replacement : String) -> Stringreplace_all : (Regex) fn(self : Regex, input : String, replacement : String) -> String
RegexMatch
object
RegexMatch
Fields
| Name | Type | Description |
|---|---|---|
_value | String | |
_index | usize | |
_input | String | |
_groups | <struct:struct_yo_id_64661> | |
_group_names | <struct:struct_yo_id_62215> |
Methods
new : (RegexMatch) fn(value : String, index : usize, input : String, groups : <struct:struct_yo_id_64661>, group_names : <struct:struct_yo_id_62215>) -> RegexMatchParameters
| Name | Type | Notes |
|---|---|---|
value | String | |
index | usize | |
input | String | |
groups | <struct:struct_yo_id_64661> | |
group_names | <struct:struct_yo_id_62215> |
Returns: RegexMatch
value : (RegexMatch) fn(self : RegexMatch) -> Stringindex : (RegexMatch) fn(self : RegexMatch) -> usizeinput : (RegexMatch) fn(self : RegexMatch) -> Stringgroup : (RegexMatch) fn(self : RegexMatch, idx : usize) -> <enum:enum_yo_id_4590>named_group : (RegexMatch) fn(self : RegexMatch, name : String) -> <enum:enum_yo_id_4590>group_count : (RegexMatch) fn(self : RegexMatch) -> usize
RegexFlags
struct
RegexFlags
Fields
| Name | Type | Description |
|---|---|---|
global | bool | |
ignore_case | bool | |
multiline | bool | |
dot_all | bool | |
unicode | bool | |
sticky | bool |
Methods
default : (RegexFlags) fn() -> RegexFlagsReturns: RegexFlags
parse : (RegexFlags) fn(flags_str : String) -> <enum:enum_yo_id_64030>