MCPcopy Create free account
hub / github.com/davidblewett/rure-python / new_many

Method new_many

regex/src/exec.rs:138–143  ·  view source on GitHub ↗

Like new, but compiles the union of the given regular expressions. Note that when compiling 2 or more regular expressions, capture groups are completely unsupported. (This means both `find` and `captures` wont work.)

(res: I)

Source from the content-addressed store, hash-verified

136 /// are completely unsupported. (This means both `find` and `captures`
137 /// wont work.)
138 pub fn new_many<I, S>(res: I) -> Self
139 where S: AsRef<str>, I: IntoIterator<Item=S> {
140 let mut opts = RegexOptions::default();
141 opts.pats = res.into_iter().map(|s| s.as_ref().to_owned()).collect();
142 Self::new_options(opts)
143 }
144
145 /// Create a regex execution builder.
146 pub fn new_options(opts: RegexOptions) -> Self {

Callers

nothing calls this directly

Calls 3

mapMethod · 0.80
as_refMethod · 0.80
into_iterMethod · 0.45

Tested by

no test coverage detected