in reply to Re^2: regex: something...(!something)...something
in thread regex: something...(!something)...something

For this, I'd use instead:

use strict; use warnings; my $text="<tr><td>1</td><td>2</td><td>qw<font>3</font></td><td>4</td>< +tr>"; my @blocks = split /<td>(.*?)<\/td>/, $text; foreach my $block (@blocks) { if($block =~ /3/) { print $block."\n"; } }

outputs

qw<font>3</font>

But you should consider one of the many HTML parser modules.