#!/usr/bin/perl use strict; use warnings; $_ = <<'--';
Foo text
Text text.
Bla
Bla bla Bla!
Inner!
-- my $div; $div = qr {
(?: (?>[^<]+) | <(?!/?div) | (??{$div}) ) *
}ix; my $iwant = qr {
(?: (?>[^<]+) | <(?!/?div) | (??{$div}) ) *
}ix; print $&, "\n" if /$iwant/; # Don't try to be the smartass # to point out potential issues # about $&. They are irrelevant # here. __END__
Text text.
Bla
Bla bla Bla!
Inner!