# stuff we want to capture my $capture_this = qr{ ... }xms; my $capture_too = qr{ ... }xms; my $capture_also = qr{ ... }xms; my $capture_more = qr{ ... }xms; # stuff we want to cause match failure if before certain other stuff my $avoid_this = qr{ ... }xms; my $avoid_too = qr{ ... }xms; my $avoid_also = qr{ ... }xms; my $negatory = qr{ (?> [aeiou]+ | f[eio]e? | $avoid_too) }xms; # stuff we need for an overall match, may or may not be captured my $needed_for_match = qr{ ... }xms; my $needed_too = qr{ ... }xms; my $string = get_stringy_stuff(); my ($this, $too, $also, $yet_another) = $string =~ m{ \A ($capture_this) ($capture_too) ... (?> (?> $avoid_this | $avoid_too | $avoid_also | etc) $needed_for_match (*SKIP)(*F))? $needed_for_match # needed for overall match ($capture_also) ... (?> $negatory $needed_too (*SKIP)(*FAIL))? ($needed_too) # needed for overall match, also captured \z }xms; do_something_with($this, $too, $also, $yet_another);