MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / search

Function search

std/re/src/lib.rs:97–99  ·  view source on GitHub ↗
(pattern: String, string: String)

Source from the content-addressed store, hash-verified

95 /* search: leftmost match anywhere, returns group 0 or None. */
96 #[plugin_fn]
97 fn search(pattern: String, string: String) -> Result<Option<String>> {
98 Ok(rx(main::find(&pattern, &string, Mode::Search))?.map(|f| f.text))
99 }
100
101 /* fullmatch: the pattern must consume the whole string. */
102 #[plugin_fn]

Callers

nothing calls this directly

Calls 2

rxFunction · 0.85
findFunction · 0.50

Tested by

no test coverage detected