use strict; use warnings; use 5.010; my $line = do { local $/ = undef; ; }; my @tt_content = ($line =~ m|<\s*tt\s*>([^<]+)|gim); say "Found: "; say for @tt_content; __DATA__ NEVER USE REGEX AS HTML PARSER! < tt >" Hia ha ho " < TT >a