#!/usr/bin/perl use strict; use warnings; my $line = ; # First capture the row: if ($line =~ /(BBBBB.*?)<\/tr>/) { # Then capture the cells: my @data = $1 =~ /([^<]+)<\/td>/g; print $_ for @data; } __DATA__

AAA 28/07/2018

1351990783523

BBBBB 01/08/2018
236002121266

KK K P 25/07/2018

2003345667137