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 class  RegexSynth.Flags  
  • Constructor Summary

    Constructors 
    Constructor Description
    RegexSynth​(Expression... expressions)
    Creates a complete regular expression.
  • Method Summary

    Modifier and Type Method Description
    RegexSynth compile​(RegexSynth.Flags... flags)
    Compiles the created regular expression pattern into a RE2 Pattern instance.
    java.lang.String getExpression()  
    static java.util.Map<java.lang.Integer,​java.lang.String> getMatchedGroups​(com.google.re2j.Matcher matcher)
    Creates a list of matched groups in the Matcher instance.
    com.google.re2j.Pattern getPattern()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RegexSynth

      public RegexSynth​(Expression... expressions)
      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 the Matcher instance. This is just a convenience function.
      Parameters:
      matcher - matched instance for CharSequence
      Returns:
      match that maps to a group id
    • compile

      public RegexSynth compile​(RegexSynth.Flags... flags)
      Compiles the created regular expression pattern into a RE2 Pattern instance.
      Parameters:
      flags - global modifiers
      Returns:
      Re2J Pattern instance
    • getPattern

      public com.google.re2j.Pattern getPattern()
    • getExpression

      public java.lang.String getExpression()