pub trait RegExpProvider {
// Required method
fn compile(
&self,
pattern: &str,
flags: &str,
) -> Result<Rc<dyn CompiledRegex>, String>;
}Expand description
Trait for providing regex compilation functionality.
Implementations can wrap different regex engines:
FancyRegexProvider: Uses thefancy-regexcrate (default for std builds)WasmRegExpProvider: Delegates to browser’s native RegExp via wasm-bindgen- Custom C implementations via FFI callbacks
Required Methods§
Sourcefn compile(
&self,
pattern: &str,
flags: &str,
) -> Result<Rc<dyn CompiledRegex>, String>
fn compile( &self, pattern: &str, flags: &str, ) -> Result<Rc<dyn CompiledRegex>, String>
Compile a regex pattern with the given flags.
§Flags
g: global (affects JS-level iteration, not compilation)i: case-insensitive matchingm: multiline (^ and $ match line boundaries)s: dotAll (. matches newlines)u: unicodey: sticky (match only at lastIndex)
Returns a compiled regex that can be used for matching operations.