#!/usr/bin/env perl -l use strict; use warnings; my $html = ''; my $re = qr{<[^>]+>([^<]*)<[^>]+>}; print "The idea is to reduce:\n", $html; $html =~ s/$re/$1/; print "to\n", $html;