![]() |
VOOZH | about |
The pattern() method of theMatcher class is used to get the pattern to be matched by this matcher.
Example 1: The below example demonstrates how the pattern() method retrieves the regex pattern "G.*s$" used to match a string ending with "s" and starting with "G".
Pattern used: G.*s$
public Pattern pattern()
Example 2: The below example shows how the pattern() method returns the exact pattern "GFG" used to match repetitive occurrences in a string.
Pattern used: GFG