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

Function search

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

Source from the content-addressed store, hash-verified

108
109 #[pyfunction]
110 fn search(
111 pattern: PyStrRef,
112 string: PyStrRef,
113 flags: OptionalArg<usize>,
114 vm: &VirtualMachine,
115 ) -> PyResult<Option<PyMatch>> {
116 let flags = extract_flags(flags);
117 let regex = make_regex(vm, pattern.as_str(), flags)?;
118 Ok(do_search(&regex, string))
119 }
120
121 #[pyfunction]
122 fn sub(

Callers

nothing calls this directly

Calls 4

extract_flagsFunction · 0.85
make_regexFunction · 0.85
do_searchFunction · 0.85
as_strMethod · 0.45

Tested by

no test coverage detected