I'm trying to create a regex in ES6, with a String Literal, but my solution fails :
var prefix = 'Hello';
var re = /`${prefix}\\s(\\w+)\\s(\\w+)`/;
//var re = /Hello\s(\w+)\s(\w+)/; // this works
var str = 'Hello John Smith';
var newstr = str.replace(re, '$2, $1');
console.log(newstr);