<pre><code>Pattern pattern = Pattern.compile("^[a-z]+$");
String string = "abc-def";
assertTrue( pattern.matcher(string).matches() ); // obviously fails
</code></pre>

<p>Is it possible to have the character class match a "-" ?</p>

Escape the minus sign
```
```
[a-z\\-]
```
```