const regex = new RegExp('(?:.*|)NY TORRENT: [a-zA-Z&]+ \\w+ (.*-[a-zA-Z]+).*', 'gm')
const str = `NY TORRENT: Dance Single Croatia_Squad_-_Touch_Me-(ETR236)-WEB-2014-XDS 41.62MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1972)
NY TORRENT: Dance Single Croatia_Squad_-_Touch_Me-(ETR236)-WEB-2014-XDS 41.62MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1972)
NY TORRENT: R&B Album David_Guetta-Listen-2CD-2014-VOiCE 116.67MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1973)
NY TORRENT: Club Single DJ_EBO_-_Triple_Jump_98-Vinyl-1998-iDC 33.98MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1974)
(22:15:27) (@TTBot) NY TORRENT: Dance Single Audio_Hedz_and_Bones_-_Boom_Bang-(OMP_004)-WEB-2013-NRG 14.58MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1749)
(22:15:27) (@TTBot) NY TORRENT: Dance Single Bounce_Enforcerz_-_Good_Dawn-(RRBEG)-WEB-2014-NRG 16.12MB (http://tunetraxx.org/?p=torrents&pid=10&action=details&tid=1750)`;
const subst = `\1`;
// 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