MCPcopy Index your code
hub / github.com/RustPython/RustPython / match_

Function match_

crates/stdlib/src/re.rs:98–107  ·  view source on GitHub ↗
(
        pattern: PyStrRef,
        string: PyStrRef,
        flags: OptionalArg<usize>,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

96
97 #[pyfunction(name = "match")]
98 fn match_(
99 pattern: PyStrRef,
100 string: PyStrRef,
101 flags: OptionalArg<usize>,
102 vm: &VirtualMachine,
103 ) -> PyResult<Option<PyMatch>> {
104 let flags = extract_flags(flags);
105 let regex = make_regex(vm, pattern.as_str(), flags)?;
106 Ok(do_match(&regex, string))
107 }
108
109 #[pyfunction]
110 fn search(

Callers

nothing calls this directly

Calls 4

extract_flagsFunction · 0.85
make_regexFunction · 0.85
do_matchFunction · 0.85
as_strMethod · 0.45

Tested by

no test coverage detected