Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.