$data->{pubText} =~ /\A((?:\w+\s){14}\w+).+/; my $text = $1 if defined $1; # ...