What’s the difference between String.matches and Matcher.matches? Is there any difference in terms of performance or other things?
What’s the difference between String.matches and Matcher.matches? Is there any difference in terms of
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Absolutely. A
Matcheris created on on a precompiled regexp, whileString.matchesmust recompile the regexp every time it executes, so it becomes more wasteful the more often you run that line of code.