Prev Next

Java / Regular expressions

Explain the difference between String.matches and Matcher.matches.

Matcher.matches() is good in terms of performance as a Matcher is created on a precompiled regular expressions, while the String.matches() recompiles the regular expression every time it executes.

More Related questions...

Show more question and Answers...


Comments & Discussions