title: Should I use a Java Regex Pattern or simple System Format?
body: <p>I'm currently trying to to set up a program so the user must enter a specific string of characters for example <code>DeskID</code> followed by 2-3 ints, thus: <code>DeskNO10</code> or <code>DeskNO42</code> <br></p>
  
  <p>At the moment, I have tried:</p>
  
  <pre><code>if(Pattern.matches("[DeskNO0-9]",desk)) {
      System.out.println("Accepted");
  } else {
      System.out.println("Rejected");
  }
  </code></pre>
  
  <p>This doesn't work - is there any suggestions I could make it work or would it be advisable, if I just use a simple <code>println</code> statement using <code>%s</code> and <code>%2d</code> </p>