Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current ·  View Page History

RegExp

matcher.maches() return false

Why this code fails ?

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

From Javadoc: http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html#matches()

public boolean matches()
Attempts to match the entire region against the pattern.
...

So "/\.groovy/" is just a subsequence.
You must use

Labels
  • None