const regex = /=+|GOLIATH/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('=+|GOLIATH', 'g')
const 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.
=====================================================================================`;
const subst = ``;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);
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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions