Class Operators

java.lang.Object
dev.yasint.regexsynth.ast.Operators

public final class Operators
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Operators()  
  • Method Summary

    Modifier and Type Method Description
    static Expression concat​(Expression... expressions)
    Concatenates multiple expressions at once.
    static Expression concat​(Expression a, Expression b)
    Creates a concatenation of two given regular expressions.
    static Expression either​(Expression... expressions)
    Creates an alternation between the passed expressions.
    static Expression either​(java.lang.String... strings)
    Creates an alternation between multiple strings.
    static Expression either​(java.util.Set<java.lang.String> strings)
    Creates an alternation between multiple strings.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • either

      public static Expression either​(Expression... expressions)
      Creates an alternation between the passed expressions. [A-Z]|[a-z]|[0-9]
      Parameters:
      expressions - alternations
      Returns:
      wrapped alternated expressions
    • either

      public static Expression either​(java.lang.String... strings)
      Creates an alternation between multiple strings. {January,February,March} = (?:Jan|Febr)uary|March)
      Parameters:
      strings - alternation strings
      Returns:
      wrapped alternated strings
    • either

      public static Expression either​(java.util.Set<java.lang.String> strings)
      Creates an alternation between multiple strings. {January,February,March} = (?:Jan|Febr)uary|March)
      Parameters:
      strings - alternation strings
      Returns:
      wrapped alternated strings
    • concat

      public static Expression concat​(Expression a, Expression b)
      Creates a concatenation of two given regular expressions. Note: it simply just append the second expression. (a followed by b)
      Parameters:
      a - expression a
      b - expression b
      Returns:
      concatenated expression.
    • concat

      public static Expression concat​(Expression... expressions)
      Concatenates multiple expressions at once. Expressions will combined in absolute order.
      Parameters:
      expressions - multiple expressions
      Returns:
      concatenated expressions.