forked from mirrors/gecko-dev
		
	Differential Revision: https://phabricator.services.mozilla.com/D54616 --HG-- rename : third_party/rust/itoa/LICENSE-MIT => third_party/rust/ffi-support/LICENSE-MIT rename : third_party/rust/regex/src/literal/mod.rs => third_party/rust/regex/src/literal/imp.rs rename : third_party/rust/ryu/benchmark/benchmark.rs => third_party/rust/ryu/examples/upstream_benchmark.rs rename : third_party/rust/ryu/src/mulshift128.rs => third_party/rust/ryu/src/d2s_intrinsics.rs extra : moz-landing-system : lando
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			483 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			483 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
extern crate regex;
 | 
						|
 | 
						|
use std::io::{self, Read};
 | 
						|
 | 
						|
macro_rules! regex {
 | 
						|
    ($re:expr) => {{
 | 
						|
        use regex::internal::ExecBuilder;
 | 
						|
        ExecBuilder::new($re).build().unwrap().into_regex()
 | 
						|
    }};
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    let mut seq = String::with_capacity(50 * (1 << 20));
 | 
						|
    io::stdin().read_to_string(&mut seq).unwrap();
 | 
						|
    let ilen = seq.len();
 | 
						|
 | 
						|
    seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned();
 | 
						|
    println!("original: {}, replaced: {}", ilen, seq.len());
 | 
						|
}
 |