my @numbers = m{ # End of opening tag \s* # Optional whitespace ([0-9]+) # The number you want \s* # Optional whitespace # Closing tag }gx; # I want all of them in this line