Help for this page

Select Code to Download


  1. or download this
    my (@match) = $str =~ /(?:^foo (?=(?:m \d+ )+bar)|(?<!^)\G)m (\d+) /g;
    
  2. or download this
    my (@match) = $str =~
      / (?: ^foo\ (?= (?:m\ \d+\ )+bar) # overall match from ^foo
    ...
        )
        m\ (\d+)\                       # grab each digit sequence
      /xg;