Ruby\'s Test::Unit has a nice assert_matches method that can be used in unit tests to assert that a regex matches a string.
Is there anythi
Because I was also looking for this functionality, I have started a project on GitHub called regex-tester. It's a library that helps ease testing regular expressions in Java (only works with JUnit currently).
The library is very limited right now, but it does have a Hamcrest matcher that works like this
assertThat("test", doesMatchRegex("tes.+"));
assertThat("test", doesNotMatchRegex("tex.+"));
More about how to use regex-tester is here.