title: Search for a word in a String
body: <p>If I am looking for a particular word inside a string, for example, in the string "how are you" I am looking for "are".
   Would a regular indexOf() work faster and better or a Regex match()</p>
  
  <pre><code>String testStr = "how are you";
  String lookUp = "are";
  
  //METHOD1
  if (testStr.indexOf(lookUp) != -1)
  {
   System.out.println("Found!");
  }
  
  //OR
  //METHOD 2
  if (testStr.match(".*"+lookUp+".*"))
  {
   System.out.println("Found!");
  }
  </code></pre>
  
  <p>Which of the two methods above is a better way of looking for a string inside another string? Or is there a much better alternative?</p>
  
  <ul>
  <li>Ivard</li>
  </ul>