15 lines
287 B
Rust
15 lines
287 B
Rust
use std::fs;
|
|
|
|
use regex::Regex;
|
|
|
|
fn main() {
|
|
const PATH: &str = "independance.txt";
|
|
|
|
let file = fs::read_to_string(PATH).unwrap();
|
|
|
|
let regex = Regex::new(r"libert[e|é]").unwrap();
|
|
|
|
let count = regex.find_iter(&file).count();
|
|
|
|
println!("Found {} matches", count);
|
|
}
|