Java Matcher matches() methodThe matches() method of Matcher class is used to match the input sequence against the whole text. It takes care of matching of the pattern from the beginning to the end. While the lookingAt method matches the regular expression against the beginning of the text only. Syntax:Parameter:No Parameter Returns:true if, and only if, the entire region sequence matches this matcher's pattern Example 1Test it NowOutput: matches = true Example 2Test it NowOutput: start : 0 End : 29
Next TopicJava Matcher class
|