title: ES6-like templating in ES5 - doesn't work when attribute names have .'s in
body: <p>I found this function <a href="https://medium.com/@zackargyle/es6-like-template-strings-in-10-lines-a88caca6f36c" rel="nofollow noreferrer">here</a>, which allows ES6-like templating in ES5.</p>
  
  <pre><code>String.prototype.eval = function(data) {
  return this.replace(/\${(.*?)}/g, function(_, code) {
      var scoped = code.replace(/(["'\.\w\$]+)/g, function(match) {
        return /["']/.test(match[0]) ? match : 'scope.' + match;
      });
      try {
          return new Function('scope', 'return ' + scoped)(data);
      } catch (e) { return ''; }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>It works very well, except for when attribute names include .'s (dots) in them.
  My regex skills aren't up to scratch, how can I enable it to deal with attribute names that include .'s (dots)?  </p>
  
  <p>i.e. "MY_ATTRIBUTE" works whereas "MY_ATTRIBUTE.A" does not.</p>