title: Java Pattern for Word without Spaces
body: <p>I am wondering what the regex for a word would be, I can seem to find it anywhere? The string I\m trying to match "Loop-num + 5" and I want to extract the "Loop-num" part. I am unsure what the regex would be to do so.</p>
  
  <pre><code>Pattern pattern = Pattern.compile("(loop-.*)");
  Matcher matcher = pattern.matcher("5 * loop-num + 5");
  if(matcher.find()){
      String extractedString = matcher.group(1);
      System.out.println(extractedString);
  }
  </code></pre>
  
  <p>From this I get: "loop-num + 5"</p>