 <p>You got the parameters in the wrong order (from the <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#matches%28java.lang.String,%20java.lang.CharSequence%29">documentation</a>)</p> <pre><code>Pattern.matches(String regex, CharSequence input) </code></pre>