title: Javascript capitalize first letter of each word in a string only if lengh > 2
body: <p>I looked at some questions and answers about capitalize in StackOverflow but could not find answer about my problem.</p>
  
  <p>I would like to capitalize first letter of each word in a string only if word lengh > 2.</p>
  
  <p>My temporary solution was:</p>
  
  <pre><code>var str =  str.toLowerCase().replace(/\b[a-z]/g, function (letter) {
                  return letter.toUpperCase();
              }).replace(/\b\w{1,2}\b/g, function (letter) {
                  return letter.toLowerCase();
              });
  </code></pre>
  
  <p>There is a solution that can unite the two regex in one?</p>