jcabi/jcabi-matchers

RegexMatchers

carlosmiranda opened this issue · 15 comments

When I was working on jcabi/jcabi-aspects#88, I needed to create a unit test that used Regex matching as its assertion condition. I realized that Hamcrest did not have built-in matchers for regex. I think it will be very useful if we can have one as standard.

I propose that we create a class RegexMatchers, which will initially have the following methods:

  • Matcher<String> matchesPattern(String pattern): returns a Matcher that checks if the entire string matches the given pattern (should work like the String.matches() method).
  • Matcher<String> containsPattern(String pattern): returns a Matcher that checks if a string contains a subsequence that matches the given pattern (similar to Matcher.find() method).

it's a very good idea, thanks!

I'll ask someone to take care of this task soon

thanks for reporting! I topped your account for 15 mins, transaction 45545110

@yegor256 , @dmarkov can I work on this myself?

@dmarkov assign @carlosmiranda to this ticket pls

@carlosmiranda don't forget about site documentation

@dmarkov assign @carlosmiranda to this ticket pls

@yegor256 OK @carlosmiranda please go ahead, this task is yours

I made a pull request at #11.

Addressed in #11.

@rultor release, tag is 1.3

@rultor release, tag is 1.3

@yegor256 OK, I will release it now. Please check the progress here

@rultor release, tag is 1.3

@yegor256 Done! FYI, the full log is here (took me 15min)

@carlosmiranda 30 mins added to your account (payment number 45803042), many thanks for your contribution!

in progress: 10-7b3f9a1b, 10-8e2f1dc4

last puzzled solved 10-8e2f1dc4/#14