// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?m)\b(?!TSPU\b)[A-Z]{4,}(?:(?:\s+\w\.)?\s+\w+)?").unwrap();
let string = "JINA L. CHOI (NY Bar No. 2699718)
ERIN E. SCHNEIDER (Cal. Bar No. 216114) schneidere@sec.gov
MONIQUE C. WINKLER (Cal. Bar No. 213031) winklerm@sec.gov
JASON M. HABERMEYER (Cal. Bar No. 226607) habermeyerj@sec.gov
MARC D. KATZ (Cal. Bar No. 189534) katzma@sec.gov
JESSICA W. CHAN (Cal. Bar No. 247669) chanjes@sec.gov
RAHUL KOLHATKAR (Cal. Bar No. 261781) kolhatkarr@sec.gov
The Investor Solicitation Process Generally Included a Face-to-Face Meeting, a Technology Demonstration, and a Binder of Materials [...]
TSPU or taken
TSPU or the
TSPU only
TSPU was
TSPU and";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/