title: Use Java Regex to find multiple matching words in a sentence
body: <p>I have a sentence, and a set of words say; Mayweather, undefeated … etc.
  I want to: </p>
  
  <ol>
  <li>check if the sentence contains any of the above mentioned words… (I want it to look for matching words only, basically ignore full-stops, commas and new lines.) </li>
  <li>and if it does, I want to display few words before and after each matching word, maybe by using <code>String.format()</code></li>
  </ol>
  
  <p>Here’s my code which seems to be working OK but not exactly how I want it:</p>
  
  <pre><code>String sentence = "Floyd Mayweather Jr is an American professional boxer " +
              "currently undefeated as a professional and is a five-division world champion, " +
              "having won ten world titles and the lineal championship in four different weight classes.";
  
      String newText = "";
      Pattern p = Pattern.compile("(Mayweather) .* (undefeated)");
      Matcher m = p.matcher(sentence);
  
      if (m.find()) {
          String group1 = m.group(1);
          String group2 = m.group(2);
  
          newText = String.format("%s ... %s" , group1, group2);
          System.out.println(newText);
      }
  </code></pre>
  
  <p>The output now is:</p>
  
  <blockquote>
    <p>Mayweather ... undefeated</p>
  </blockquote>
  
  <p>What I want is something like this:</p>
  
  <blockquote>
    <p>Floyd Mayweather Jr is an American ... currently undefeated as a professional ... </p>
  </blockquote>
  
  <p>Can you please let me know how to do it, or guide me to the right direction cuz I’m stuck.</p>
  
  <p>Thanks in advance guys.</p>