1 use std::io::{self, Read}; 2 3 macro_rules! regex { 4 ($re:expr) => {{ 5 use regex::internal::ExecBuilder; 6 ExecBuilder::new($re).build().unwrap().into_regex() 7 }}; 8 } 9 main()10fn main() { 11 let mut seq = String::with_capacity(50 * (1 << 20)); 12 io::stdin().read_to_string(&mut seq).unwrap(); 13 let ilen = seq.len(); 14 15 seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); 16 println!("original: {}, replaced: {}", ilen, seq.len()); 17 } 18