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

Function do_search

crates/stdlib/src/re.rs:178–183  ·  view source on GitHub ↗
(regex: &PyPattern, search_text: PyStrRef)

Source from the content-addressed store, hash-verified

176 }
177
178 fn do_search(regex: &PyPattern, search_text: PyStrRef) -> Option<PyMatch> {
179 regex
180 .regex
181 .captures(search_text.as_bytes())
182 .map(|captures| create_match(search_text.clone(), captures))
183 }
184
185 fn do_findall(vm: &VirtualMachine, pattern: &PyPattern, search_text: PyStrRef) -> PyResult {
186 let out = pattern

Callers 2

searchFunction · 0.85
searchMethod · 0.85

Calls 4

create_matchFunction · 0.85
mapMethod · 0.45
as_bytesMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected