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

    Modifier and Type Method Description
    static com.google.re2j.Pattern compile​(java.lang.String expression, RegexSynth.Flags... flags)
    Compiles the created regular expression pattern into a RE2 Pattern instance.
    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.
    static java.lang.String regexp​(Expression... expressions)
    Creates a complete regular expression.

    Methods inherited from class java.lang.Object

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

    • regexp

      public static java.lang.String regexp​(Expression... expressions)
      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 RE2 Pattern instance.
      Parameters:
      expression - final expression
      flags - 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 the Matcher instance. This is just a convenience function.
      Parameters:
      matcher - matched instance for CharSequence
      Returns:
      match that maps to a group id