Package dev.yasint.regexsynth.core
Class RegexSynth
java.lang.Object
dev.yasint.regexsynth.core.RegexSynth
public final class RegexSynth
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegexSynth.Flags -
Method Summary
Modifier and Type Method Description static com.google.re2j.Patterncompile(java.lang.String expression, RegexSynth.Flags... flags)Compiles the created regular expression pattern into a RE2Patterninstance.static java.util.Map<java.lang.Integer,java.lang.String>getMatchedGroups(com.google.re2j.Matcher matcher)Creates a list of matched groups in theMatcherinstance.static java.lang.Stringregexp(Expression... expressions)Creates a complete regular expression.
-
Method Details
-
regexp
Creates a complete regular expression. It combines all the sub expressions into one.- Parameters:
expressions- sub-expressions- Returns:
- string representation of the expression
-
compile
public static com.google.re2j.Pattern compile(java.lang.String expression, RegexSynth.Flags... flags)Compiles the created regular expression pattern into a RE2Patterninstance.- Parameters:
expression- final expressionflags- global modifiers- Returns:
- Re2J Pattern instance
-
getMatchedGroups
public static java.util.Map<java.lang.Integer,java.lang.String> getMatchedGroups(com.google.re2j.Matcher matcher)Creates a list of matched groups in theMatcherinstance. This is just a convenience function.- Parameters:
matcher- matched instance forCharSequence- Returns:
- match that maps to a group id
-