use strict;
my $str = '=====================================================================================
GOLIATH
=====================================================================================
*** GOLIATH BACKUP CHECK *** GOLIATH BACKUP CHECK *** GOLIATH BACKUP CHECK ***
====]] GOLIATH Backup Check Results [[====
--] Remote Reachability Test
Pings were NOT successful to 172.16.158.1 from remote router uscmcraudfl04r.
USCMCRAUDFL04R#ping 172.16.158.1 source FastEthernet0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.158.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.112.1
.....
Success rate is 0 percent
--] Backup Device Test
GOLIATH did not detect any backup devices connected to the router.
--] Back-to-Back Test
No SMARTS Back-to-Back connections detected.
GOLIATH did not detect any iBGP connections for this device.
--] ISDN Test
No ISDN interfaces detected on router or B2B routers.
=====================================================================================';
my $regex = qr/=+|GOLIATH/p;
my $subst = '';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html