// 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)[^第]([ -~φθ°α’−]+)(?![個])").unwrap();
let string = " 第2の装置1gbは、実施の形態9においてその詳細を説明した装置1であって、1 + Y個のMOSトランジスタを備える。各MOSトランジスタの状態は、保護IC 88により制御される。
そして、9以上のMOSトランジスタを備えてもよいし、11以上のMOSトランジスタを備えてもよいし、N以上のMOSトランジスタを備えてもよい。
そして、8個のMOSトランジスタを備えてもよいし、12個のMOSトランジスタを備えてもよいし、N個のMOSトランジスタを備えてもよい。";
// 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/