How to write a regular expression in js to replace multiple matching substrings at the end of a string

input:
"aaaaddabcabcabc"

use regular to replace the ending n "abc" with"
output:
"aaaadd"

the following can only replace the last substring:

nt
n

"

\n\tqwe

\n\t<br />\n

qwe\n

\n

\n\t<br />\n

\n

\n\t<br />\n

\n

\n\t<br />\n

\n

\n\t<br />\n

\n

\n\t<br />\n

\n

\n\t<br />\n

" .replace(/(

\n\t<br \/>\n<\/p>)*$/g,"");


'aaaaddabcabcabc'.replace(/(abc)*$/g,''); //"aaaadd"
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b330b1-2be6c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b330b1-2be6c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?