Enum Class RegexpFlag

java.lang.Object
java.lang.Enum<RegexpFlag>
org.elasticsearch.index.query.RegexpFlag
All Implemented Interfaces:
Serializable, Comparable<RegexpFlag>, Constable

public enum RegexpFlag extends Enum<RegexpFlag>
Regular expression syntax flags. Each flag represents optional syntax support in the regular expression:
  • INTERSECTION - Support for intersection notation: &lt;expression&gt; &amp; &lt;expression&gt;
  • COMPLEMENT - Support for complement notation: &lt;expression&gt; &amp; &lt;expression&gt;
  • EMPTY - Support for the empty language symbol: #
  • ANYSTRING - Support for the any string symbol: @
  • INTERVAL - Support for numerical interval notation: &lt;n-m&gt;
  • NONE - Disable support for all syntax options
  • ALL - Enables support for all syntax options
See Also:
RegexpQueryBuilder.flags(RegexpFlag...), RegexpQueryBuilder.flags(RegexpFlag...)
  • Enum Constant Details

    • INTERSECTION

      public static final RegexpFlag INTERSECTION
      Enables intersection of the form: &lt;expression&gt; &amp; &lt;expression&gt;
    • COMPLEMENT

      public static final RegexpFlag COMPLEMENT
      Enables complement expression of the form: ~&lt;expression&gt;
    • EMPTY

      public static final RegexpFlag EMPTY
      Enables empty language expression: #
    • ANYSTRING

      public static final RegexpFlag ANYSTRING
      Enables any string expression: @
    • INTERVAL

      public static final RegexpFlag INTERVAL
      Enables numerical interval expression: &lt;n-m&gt;
    • NONE

      public static final RegexpFlag NONE
      Disables all available option flags
    • ALL

      public static final RegexpFlag ALL
      Enables all available option flags
  • Method Details

    • values

      public static RegexpFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RegexpFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • value

      public int value()
    • resolveValue

      public static int resolveValue(String flags)
      Resolves the combined OR'ed value for the given list of regular expression flags. The given flags must follow the following syntax:

      flag_name(|flag_name)*

      Where flag_name is one of the following:

      • INTERSECTION
      • COMPLEMENT
      • EMPTY
      • ANYSTRING
      • INTERVAL
      • NONE
      • ALL

      Example: INTERSECTION|COMPLEMENT|EMPTY

      Parameters:
      flags - A string representing a list of regular expression flags
      Returns:
      The combined OR'ed value for all the flags