title: Regex whole word
body: <p>I feel a little silly asking this question, but from everything I've read, this should work and it doesn't, for me.  I'm just trying to match a whole word in a string using regular expressions.  </p>
  
  <p>So, if I'm trying to find the word "the" in a sentence, it should return true for "the quick brown fox jumps over the lazy dog", but return false for "there quick brown fox jumps over the lazy dog".</p>
  
  <p>I've tried this:</p>
  
  <pre><code> String text = "the quick brown fox jumps over the lazy dog";
   return text.matches("\\bthe\\b");
  </code></pre>
  
  <p>I've also tried:</p>
  
  <pre><code>    String text = "the quick brown fox jumps over the lazy dog";
      String regex = "\\bthe\\b";
      Pattern pattern = Pattern.compile(regex);
      Matcher matcher = pattern.matcher(text);
  
      return matcher.matches();
  </code></pre>
  
  <p>I've also tried this regex: "\bthe\b"</p>
  
  <p>And they always return false.  I feel like I'm missing something pretty obvious here, since this shouldn't be too difficult. :)</p>