(Regex help) How to filter strings using regex

I need to filter strings that follow the rules below

  1. Must not contain any of ab , cd , pq , or xy
  2. Must contain a vowel
  3. Must contain at least one letter that appears at least twice in a row (like mm, zz etc)
pub fn p1(lines: &str) -> u32 {
      .split_whitespace().filter(|line| { /* regex filter goes here */ })
      .count() as u32

I'm not familiar with regex. I came up with the following regex rule but the regex crate doesn't seem to support look-around.

pub fn p1(args: &str) -> u32 {
    let regexp = regex::RegexSet::new(&[
    let mut count = 0u32;
        .for_each(|c| {
            println!("{:?}", c);
            count += 1;

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.