Package org.forgerock.openig.regex
Class StringPatternMatches
- java.lang.Object
-
- org.forgerock.openig.regex.StringPatternMatches
-
public class StringPatternMatches extends Object
Iterates through multiple regular expression matches within a character sequence.
-
-
Constructor Summary
Constructors Constructor Description StringPatternMatches​(CharSequence input, Collection<Pattern> patterns, boolean discard)
Constructs a new string pattern match iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Returnstrue
if the character sequence has more matches.Matcher
next()
Returns the next match from the character sequence.
-
-
-
Constructor Detail
-
StringPatternMatches
public StringPatternMatches​(CharSequence input, Collection<Pattern> patterns, boolean discard)
Constructs a new string pattern match iterator. Ifdiscard
istrue
, then a pattern is discarded after it is first matched.- Parameters:
input
- the character sequence to match regular expression patterns against.patterns
- a collection of regular expression patterns to match.discard
- indicates patterns be discarded after they yield a match.
-
-
Method Detail
-
next
public Matcher next()
Returns the next match from the character sequence. Matches are returned in the order they are encountered in the character sequence, then by the order they are expressed in the supplied patterns collection.- Returns:
- the next
Matcher
from the character sequence. - Throws:
NoSuchElementException
- if the reader has no more matches.
-
hasNext
public boolean hasNext()
Returnstrue
if the character sequence has more matches.- Returns:
true
if the character sequence has more matches.
-
-