title: Regular Expression to match word repeated twice (i.e. hello hello hello)
body: <p>I have a java regular expression given by my CS2 instructor that checks if a word is repeated:</p>
  
  <pre><code>\\b(\\w+)\\s+\\1\\b
  </code></pre>
  
  <p>How can I modify this to check if a word is repeated <strong>twice</strong> as in "hello hello hello" or "hello world hello hello"</p>
  
  <p>If possible, I'd just like to be pointed in the right direction, not an outright solution (after all, I need to learn this). I think my problem is that I don't understand word boundaries well.</p>