title: Regex Java "test 123" needs to fail
body: <p>So I created a program that would bring go through an input file and only pull the lines with 2 words in them. I then am trying to pull only the lines with ONLY letters. If there is any number I need it to fail. So far after researching I have come up with the code below and am just stuck on how else to get "test 123" to fail. It keeps passing.`Below is the call for my match function and the function itself.
             *
             *</p>
  
  <pre><code>else if (line.matches("[\\w\\-.]{2,} [\\w\\-.]{2,}"))
          {
              getmatch();
          } 
  
  
  
  
  public static String getMatch() 
      {
          if (line.matches("/[a-zA-Z]+/g") )
          {
              match=line;
          }
  
          return match;
      }
  </code></pre>