I need this string:
var x = \'Hi ${name}! How are you? ${name}, you are old! ${name} share with ${other} how do u ${feel}!\'
I need to know
I find this solution at #regex IRC Channel by farn user:
x.match(/\$\{([^\}]+)\}(?![\S\s]*\$\{\1\})/g);
output:
['${name}', '${other}', '${feel}']
and
x.match(/\$\{([^\}]+)\}(?![\S\s]*\$\{\1\})/g).length;
3
:)