Difference between matches() and find() in Java Regex

后端 未结 5 2017
感情败类
感情败类 2020-11-21 06:20

I am trying to understand the difference between matches() and find().

According to the Javadoc, (from what I understand), matches() will search the ent

5条回答
  •  遇见更好的自我
    2020-11-21 07:09

    matches return true if the whole string matches the given pattern. find tries to find a substring that matches the pattern.

提交回复
热议问题