Package dev.yasint.regexsynth.api
Class RegexSynth
java.lang.Object
dev.yasint.regexsynth.api.RegexSynth
public final class RegexSynth
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegexSynth.Flags -
Constructor Summary
Constructors Constructor Description RegexSynth(Expression... expressions)Creates a complete regular expression. -
Method Summary
Modifier and Type Method Description RegexSynthcompile(RegexSynth.Flags... flags)Compiles the created regular expression pattern into a RE2Patterninstance.java.lang.StringgetExpression()static java.util.Map<java.lang.Integer,java.lang.String>getMatchedGroups(com.google.re2j.Matcher matcher)Creates a list of matched groups in theMatcherinstance.com.google.re2j.PatterngetPattern()
-
Constructor Details
-
RegexSynth
Creates a complete regular expression. It combines all the sub expressions into one.- Parameters:
expressions- sub-expressions
-
-
Method Details
-
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
-
compile
Compiles the created regular expression pattern into a RE2Patterninstance.- Parameters:
flags- global modifiers- Returns:
- Re2J Pattern instance
-
getPattern
public com.google.re2j.Pattern getPattern() -
getExpression
public java.lang.String getExpression()
-