Name

java.lang.String

Description

Methods for pattern matching.

Methods

boolean matches(Stringregex)

Return true if regex matches the entire String.

String[ ] split(Stringregex)

Return an array of the substrings surrounding matches of regex.

String [ ] split(Stringregex, intlimit)

Return an array of the substrings surrounding the first limit-1 matches of regex.

String replaceFirst(Stringregex, Stringreplacement)

Replace the substring matched by regex with replacement.

String replaceAll(Stringregex, Stringreplacement)

Replace all substrings matched by regex with replacement.

Get Regular Expression Pocket Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.