Package no.digipost.text
Class Regex
- java.lang.Object
-
- no.digipost.text.Regex
-
public final class Regex extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<String>extractGroups(CharSequence text, Pattern pattern)Extract the groups from text which matches the given pattern.static Stream<String>groups(Matcher matcher)Extract the groups from aMatcher, if a match isfound.
-
-
-
Method Detail
-
extractGroups
public static Stream<String> extractGroups(CharSequence text, Pattern pattern)
Extract the groups from text which matches the given pattern.- Parameters:
text- the text to extract frompattern- The pattern which contains groups to extract.- Returns:
- The extracted groups. If the pattern does not match or does not define
any groups, the empty
streamis returned.
-
-