Enum Class RegexCompileFlags

java.lang.Object
java.lang.Enum<RegexCompileFlags>
org.gnome.glib.RegexCompileFlags
All Implemented Interfaces:
Serializable, Comparable<RegexCompileFlags>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum RegexCompileFlags extends Enum<RegexCompileFlags> implements Enumeration
Flags specifying compile-time options.
Since:
2.14
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string that is being searched.
    Letters in the pattern match both upper- and lowercase letters.
    No special options set.
    A dollar metacharacter ("$") in the pattern matches only at the end of the string.
    A dot metacharacter (".") in the pattern matches all characters, including newlines.
    Names used to identify capturing subpatterns need not be unique.
    Whitespace data characters in the pattern are totally ignored except when escaped or inside a character class.
    Limits an unanchored pattern to match before (or at) the first newline.
    By default, GRegex treats the strings as consisting of a single line of characters (even if it actually contains newlines).
    Usually any newline character or character sequence is recognized.
    Usually any newline character or character sequence is recognized.
     
    Disables the use of numbered capturing parentheses in the pattern.
    Since 2.74 and the port to pcre2, requests JIT compilation, which, if the just-in-time compiler is available, further processes a compiled pattern into machine code that executes much faster.
    Usually strings must be valid UTF-8 strings, using this flag they are considered as a raw sequence of bytes.
    Inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?".
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the numeric value of this enum
    of(int flags)
    Create a new EnumSet<RegexCompileFlags> for the provided bitfield
    of(MemorySegment address)
    Create a new EnumSet<RegexCompileFlags> for the bitfield in the provided memory address.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEFAULT

      public static final RegexCompileFlags DEFAULT
      No special options set. Since: 2.74
    • CASELESS

      public static final RegexCompileFlags CASELESS
      Letters in the pattern match both upper- and lowercase letters. This option can be changed within a pattern by a "(?i)" option setting.
    • MULTILINE

      public static final RegexCompileFlags MULTILINE
      By default, GRegex treats the strings as consisting of a single line of characters (even if it actually contains newlines). The "start of line" metacharacter ("^") matches only at the start of the string, while the "end of line" metacharacter ("$") matches only at the end of the string, or before a terminating newline (unless DOLLAR_ENDONLY is set). When MULTILINE is set, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the string, respectively, as well as at the very start and end. This can be changed within a pattern by a "(?m)" option setting.
    • DOTALL

      public static final RegexCompileFlags DOTALL
      A dot metacharacter (".") in the pattern matches all characters, including newlines. Without it, newlines are excluded. This option can be changed within a pattern by a ("?s") option setting.
    • EXTENDED

      public static final RegexCompileFlags EXTENDED
      Whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. Whitespace does not include the VT character (code 11). In addition, characters between an unescaped "" outside a character class and the next newline character, inclusive, are also ignored. This can be changed within a pattern by a "(?x)" option setting.
    • ANCHORED

      public static final RegexCompileFlags ANCHORED
      The pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string that is being searched. This effect can also be achieved by appropriate constructs in the pattern itself such as the "^" metacharacter.
    • DOLLAR_ENDONLY

      public static final RegexCompileFlags DOLLAR_ENDONLY
      A dollar metacharacter ("$") in the pattern matches only at the end of the string. Without this option, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). This option is ignored if MULTILINE is set.
    • UNGREEDY

      public static final RegexCompileFlags UNGREEDY
      Inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It can also be set by a "(?U)" option setting within the pattern.
    • RAW

      public static final RegexCompileFlags RAW
      Usually strings must be valid UTF-8 strings, using this flag they are considered as a raw sequence of bytes.
    • NO_AUTO_CAPTURE

      public static final RegexCompileFlags NO_AUTO_CAPTURE
      Disables the use of numbered capturing parentheses in the pattern. Any opening parenthesis that is not followed by "?" behaves as if it were followed by "?:" but named parentheses can still be used for capturing (and they acquire numbers in the usual way).
    • OPTIMIZE

      public static final RegexCompileFlags OPTIMIZE
      Since 2.74 and the port to pcre2, requests JIT compilation, which, if the just-in-time compiler is available, further processes a compiled pattern into machine code that executes much faster. However, it comes at the cost of extra processing before the match is performed, so it is most beneficial to use this when the same compiled pattern is used for matching many times. Before 2.74 this option used the built-in non-JIT optimizations in pcre1.
    • FIRSTLINE

      public static final RegexCompileFlags FIRSTLINE
      Limits an unanchored pattern to match before (or at) the first newline. Since: 2.34
    • DUPNAMES

      public static final RegexCompileFlags DUPNAMES
      Names used to identify capturing subpatterns need not be unique. This can be helpful for certain types of pattern when it is known that only one instance of the named subpattern can ever be matched.
    • NEWLINE_CR

      public static final RegexCompileFlags NEWLINE_CR
      Usually any newline character or character sequence is recognized. If this option is set, the only recognized newline character is '\r'.
    • NEWLINE_LF

      public static final RegexCompileFlags NEWLINE_LF
      Usually any newline character or character sequence is recognized. If this option is set, the only recognized newline character is '\n'.
    • NEWLINE_RESERVED1

      public static final RegexCompileFlags NEWLINE_RESERVED1
  • Method Details

    • values

      public static RegexCompileFlags[] 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 RegexCompileFlags 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
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static Set<RegexCompileFlags> of(int flags)
      Create a new EnumSet<RegexCompileFlags> for the provided bitfield
      Parameters:
      flags - the RegexCompileFlags bitfield
      Returns:
      the EnumSet for the provided bitfield
    • of

      public static Set<RegexCompileFlags> of(MemorySegment address)
      Create a new EnumSet<RegexCompileFlags> for the bitfield in the provided memory address.
      Parameters:
      address - the memory address holding a bitfield value
      Returns:
      the EnumSet for the bitfield in the provided memory address