Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.




matches() returns false

Why does this code fails fail?

Code Block
def matcher = "/home/me/script/test.groovy" =~ /\.groovy/
assert  matcher.matches()

Because of you think you do something like "Oh dear it contains the word!", but you're confusing matches with find


Pattern, Matcher ?

A pattern is not very usefull useful alone. He's just waiting input to process through a matcher.