@PublicAPI public class RegexpMatcher extends Object
Constructor and Description |
---|
RegexpMatcher(String pattern)
Create a new instance of RegexpMatcher.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Tell if an other matches is existing.
|
void |
matches(String toMatch)
Matches the regular expression with the given string.
|
static String[] |
matches(String pattern,
String toMatch)
Return an array that contains all the string matched by the given pattern in the given string.
|
String |
next()
Once matches, returns the next string instance matches by the pattern.
|
public RegexpMatcher(String pattern)
pattern
- the pattern to find in the string. It is no need to surround your string with the .* characters.public void matches(String toMatch)
toMatch
- the String where to find the regular expression.public String next()
public boolean hasNext()
public static String[] matches(String pattern, String toMatch)
pattern
- the pattern to find in the string. It is no need to surround your string with the .* characters.toMatch
- the String where to find the regular expression.