Created
November 24, 2017 17:36
-
-
Save frewsxcv/7ed273de76a4149ff2632a7a35c0cfd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate afl; | |
extern crate regex; | |
fn main() { | |
afl::read_stdio_string(|string| { | |
let mut split = string.split('\n'); | |
let s1 = match split.next() { | |
Some(s) => s, | |
None => return, | |
}; | |
let s2 = match split.next() { | |
Some(s) => s, | |
None => return, | |
}; | |
let re = match regex::Regex::new(s1) { | |
Ok(r) => r, | |
Err(..) => return, | |
}; | |
let _ = re.find(s2); | |
let _ = re.find_iter(s2).collect::<Vec<_>>(); | |
let _ = re.captures(s2); | |
let _ = re.captures_iter(s2).collect::<Vec<_>>(); | |
let _ = re.split(s2).collect::<Vec<_>>(); | |
let _ = re.replace(s2, s2); | |
let _ = re.replace_all(s2, s2); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment