java.util.regex.Matcher in java?
java.util.regex.Matcher in java?Explain with example.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 28, 2014, 7:19 PM
Having used the Pattern class to define a regular expression, the Matcher class is then used to match the pattern against some text.
The Matcher class doesn't have a constructor. Instead you create a Matcher object by calling the static Pattern.matcher() method.
The Matcher class has various methods including matches, find, group, start and end.
The following example illustrates the use of these methods:
Abhijeet SinghPosted Mar 28, 2014, 11:04 PM