]> granicus.if.org Git - onig/commitdiff
Add documentation on Oniguruma's many syntax flags.
authorSean Werkema <sean@werkema.com>
Sun, 17 Mar 2019 05:15:41 +0000 (01:15 -0400)
committerSean Werkema <sean@werkema.com>
Sun, 17 Mar 2019 05:15:41 +0000 (01:15 -0400)
doc/OnigurumaSyntax.md [new file with mode: 0644]

diff --git a/doc/OnigurumaSyntax.md b/doc/OnigurumaSyntax.md
new file mode 100644 (file)
index 0000000..6a031f4
--- /dev/null
@@ -0,0 +1,1046 @@
+\r
+# Oniguruma syntax (operator) configuration\r
+\r
+_Documented for Oniguruma 6.9.1_\r
+\r
+\r
+----------\r
+\r
+\r
+## Overview\r
+\r
+Configuration operators are bit flags, and are broken into multiple groups, somewhat arbitrarily,\r
+because Oniguruma takes its configuration as a trio of 32-bit `unsigned int` values, assigned as\r
+the first three fields in an `OnigSyntaxType` struct:\r
+\r
+```C\r
+typedef struct {\r
+  unsigned int   op;\r
+  unsigned int   op2;\r
+  unsigned int   behavior;\r
+  OnigOptionType options;   /* default option */\r
+  OnigMetaCharTableType meta_char_table;\r
+} OnigSyntaxType;\r
+```\r
+\r
+The first group of configuration flags (`op`) roughly corresponds to the\r
+configuration for "basic regex."  The second group (`op2`) roughly corresponds\r
+to the configuration for "advanced regex."  And the third group (`behavior`)\r
+describes more-or-less what to do for broken input, bad input, or other corner-case\r
+regular expressions whose meaning is not well-defined.\r
+\r
+\r
+----------\r
+\r
+\r
+## Group One Flags (op)\r
+\r
+\r
+This group contains "basic regex" constructs, features common to most regex systems.\r
+\r
+\r
+### 0. ONIG_SYN_OP_VARIABLE_META_CHARACTERS\r
+\r
+_Set in: none_\r
+\r
+Enables support for `onig_set_meta_char()`, which allows you to provide alternate\r
+characters that will be used instead of the six special characters that are normally\r
+these characters below:\r
+\r
+   - `ONIG_META_CHAR_ESCAPE`: `\`\r
+   - `ONIG_META_CHAR_ANYCHAR`: `.`\r
+   - `ONIG_META_CHAR_ANYTIME`: `*`\r
+   - `ONIG_META_CHAR_ZERO_OR_ONE_TIME`: `?`\r
+   - `ONIG_META_CHAR_ONE_OR_MORE_TIME`: `+`\r
+   - `ONIG_META_CHAR_ANYCHAR_ANYTIME`: Equivalent in normal regex to `.*`, but supported\r
+      explicitly so that Oniguruma can support matching SQL `%` wildcards or shell `*` wildcards.\r
+\r
+If this flag is set, then the values defined using `onig_set_meta_char()` will be used;\r
+if this flag is clear, then the default regex characters will be used instead, and\r
+data set by `onig_set_meta_char()` will be ignored.\r
+\r
+\r
+### 1. ONIG_SYN_OP_DOT_ANYCHAR (enable `.`)\r
+\r
+_Set in: PosixBasic, PosixExtended, Emacs, Grep, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the standard `.` metacharacter, meaning "any one character."  You\r
+usually want this flag on unless you have turned on `ONIG_SYN_OP_VARIABLE_META_CHARACTERS`\r
+so that you can use a metacharacter other than `.` instead.\r
+\r
+\r
+### 2. ONIG_SYN_OP_ASTERISK_ZERO_INF (enable `r*`)\r
+\r
+_Set in: PosixBasic, PosixExtended, Emacs, Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the standard `r*` metacharacter, meaning "zero or more r's."\r
+You usually want this flag set unless you have turned on `ONIG_SYN_OP_VARIABLE_META_CHARACTERS`\r
+so that you can use a metacharacter other than `*` instead.\r
+\r
+\r
+### 3. ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (disable `\*`)\r
+\r
+_Set in: none_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `*` metacharacter.  You usually want to leave this flag unset.\r
+\r
+\r
+### 4. ONIG_SYN_OP_PLUS_ONE_INF (enable `r+`)\r
+\r
+_Set in: PosixExtended, Emacs, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the standard `r+` metacharacter, meaning "one or more r's."\r
+You usually want this flag set unless you have turned on `ONIG_SYN_OP_VARIABLE_META_CHARACTERS`\r
+so that you can use a metacharacter other than `+` instead.\r
+\r
+\r
+### 5. ONIG_SYN_OP_ESC_PLUS_ONE_INF (disable `\+`)\r
+\r
+_Set in: Grep_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `+` metacharacter.  You usually want to leave this flag unset.\r
+\r
+\r
+### 6. ONIG_SYN_OP_QMARK_ZERO_ONE (enable `r?`)\r
+\r
+_Set in: PosixExtended, Emacs, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the standard `r?` metacharacter, meaning "zero or one r" or "an optional r."\r
+You usually want this flag set unless you have turned on `ONIG_SYN_OP_VARIABLE_META_CHARACTERS`\r
+so that you can use a metacharacter other than `?` instead.\r
+\r
+\r
+### 7. ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (disable `\?`)\r
+\r
+_Set in: Grep_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `?` metacharacter.  You usually want to leave this flag unset.\r
+\r
+\r
+### 8. ONIG_SYN_OP_BRACE_INTERVAL (enable `r{l,u}`)\r
+\r
+_Set in: PosixExtended, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the `r{lower,upper}` range form, common to more advanced\r
+regex engines, which lets you specify precisely a minimum and maximum range on how many r's\r
+must match (and not simply "zero or more").\r
+\r
+This form also allows `r{count}` to specify a precise count of r's that must match.\r
+\r
+This form also allows `r{lower,}` to be equivalent to `r{lower,infinity}`.\r
+\r
+If and only if the `ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV` behavior flag is set,\r
+this form also allows `r{,upper}` to be equivalent to `r{0,upper}`; otherwise,\r
+`r{,upper}` will be treated as an error.\r
+\r
+\r
+### 9. ONIG_SYN_OP_ESC_BRACE_INTERVAL (disable `\{` and `\}`)\r
+\r
+_Set in: PosixBasic, Emacs, Grep_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `{` and `}` metacharacters.  With this flag clear, `\{` and `\}` can be used to\r
+escape curly braces, if curly braces are special; but with this flag set, `\` will\r
+have no special meaning before a curly brace and will simply be treated as a literal\r
+backslash (or as whatever metacharacter escaping has been assigned to).\r
+\r
+\r
+### 10. ONIG_SYN_OP_VBAR_ALT (enable `r|s`)\r
+\r
+_Set in: PosixExtended, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `r|s` alternation operator.  You usually want this\r
+flag set.\r
+\r
+\r
+### 11. ONIG_SYN_OP_VBAR_ALT (disable `\|`)\r
+\r
+_Set in: Emacs, Grep_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `|` metacharacter.  With this flag clear, `\|` can be used to escape vertical bars,\r
+if vertical bars are special; but with this flag set, `\` will have no special meaning\r
+before a vertical bar and will simply be treated as a literal backslash (or as whatever\r
+metacharacter escaping has been assigned to).\r
+\r
+\r
+### 12. ONIG_SYN_OP_LPAREN_SUBEXP (enable `(r)`)\r
+\r
+_Set in: PosixExtended, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `(...)` grouping-and-capturing operators.  You usually\r
+want this flag set.\r
+\r
+\r
+### 13. ONIG_SYN_OP_ESC_LPAREN_SUBEXP (disable `\(` and `\)`)\r
+\r
+_Set in: PosixBasic, Emacs, Grep_\r
+\r
+This flag _disables_ the ability of the escape metacharacter (usually `\`) to escape\r
+the `(` and `)` grouping metacharacters.  With this flag clear, `\(` and `\)` can be\r
+used to escape parentheses, if parentheses are special; but with this flag set, `\`\r
+will have no special meaning before a parenthesis and will simply be treated as a\r
+literal backslash (or as whatever metacharacter escaping has been assigned to).\r
+\r
+\r
+### 14. ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (enable `\A` and `\Z` and `\z`)\r
+\r
+_Set in: GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the anchors `\A` (start-of-string), `\Z` (end-of-string or\r
+newline-at-end-of-string), and `\z` (end-of-string) escapes.\r
+\r
+(If the escape metacharacter has been changed from the default of `\`, this\r
+option will recognize that metacharacter instead.)\r
+\r
+\r
+### 15. ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (enable `\G`)\r
+\r
+_Set in: GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the special anchor `\G` (start-of-previous-match).\r
+\r
+(If the escape metacharacter has been changed from the default of `\`, this\r
+option will recognize that metacharacter instead.)\r
+\r
+Note that `OnigRegex`/`regex_t` are not stateful objects, and do _not_ record\r
+the location of the previous match.  The `\G` flag uses the `start` parameter\r
+explicitly passed to `onig_search()` (or `onig_search_with_param()` to determine\r
+the "start of the previous match," so if the caller always passes the start of\r
+the entire buffer as the function's `start` parameter, then `\G` will behave\r
+exactly the same as `\A`.\r
+\r
+\r
+### 16. ONIG_SYN_OP_DECIMAL_BACKREF (enable `\num`)\r
+\r
+_Set in: PosixBasic, PosixExtended, Emacs, Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for subsequent matches to back references to prior capture groups `(...)` using\r
+the common `\num` syntax (like `\3`).\r
+\r
+If this flag is clear, then a numeric escape like `\3` will either be treated as a literal `3`,\r
+or, if `ONIG_SYN_OP_ESC_OCTAL3` is set, will be treated as an octal character code `\3`.\r
+\r
+You usually want this enabled, and it is enabled by default in every built-in syntax.\r
+\r
+\r
+### 17. ONIG_SYN_OP_BRACKET_CC (enable `[...]`)\r
+\r
+_Set in: PosixBasic, PosixExtended, Emacs, Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for recognizing character classes, like `[a-z]`.  If this flag is not set, `[`\r
+and `]` will be treated as ordinary literal characters instead of as metacharacters.\r
+\r
+You usually want this enabled, and it is enabled by default in every built-in syntax.\r
+\r
+\r
+### 18. ONIG_SYN_OP_ESC_W_WORD (enable `\w` and `\W`)\r
+\r
+_Set in: Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `\w` and `\W` shorthand forms.  These match "word characters,"\r
+whose meaning varies depending on the encoding being used.\r
+\r
+In ASCII encoding, `\w` is equivalent to `[A-Za-z0-9_]`.\r
+\r
+In most other encodings, `\w` matches many more characters, including accented letters, Greek letters,\r
+Cyrillic letters, Braille letters and numbers, Runic letters, Hebrew letters, Arabic letters and numerals,\r
+Chinese Han ideographs, Japanese Katakana and Hiragana, Korean Hangul, and generally any symbol that\r
+could qualify as a phonetic "letter" or counting "number" in any language.  (Note that emoji are _not_\r
+considered "word characters.")\r
+\r
+`\W` always matches the opposite of whatever `\w` matches.\r
+\r
+\r
+### 19. ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (enable `\<` and `\>`)\r
+\r
+_Set in: Grep, GnuRegex_\r
+\r
+Enables support for the GNU-specific `\<` and `\>` word-boundary metacharacters.  These work like\r
+the `\b` word-boundary metacharacter, but only match at one end of the word or the other:  `\<`\r
+only matches at a transition from a non-word character to a word character (i.e., at the start\r
+of a word), and `\>` only matches at a transition from a word character to a non-word character\r
+(i.e., at the end of a word).\r
+\r
+Most regex syntaxes do _not_ support these metacharacters.\r
+\r
+\r
+### 20. ONIG_SYN_OP_ESC_B_WORD_BOUND (enable `\b` and `\B`)\r
+\r
+_Set in: Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `\b` and `\B` word-boundary metacharacters.  The `\b` metacharacter\r
+matches a zero-width position at a transition from word-characters to non-word-characters, or vice\r
+versa.  The `\B` metacharacter matches at all positions _not_ matched by `\b`.\r
+\r
+See details in `ONIG_SYN_OP_ESC_W_WORD` above for an explanation as to which characters\r
+are considered "word characters."\r
+\r
+\r
+### 21. ONIG_SYN_OP_ESC_S_WHITE_SPACE (enable `\s` and `\S`)\r
+\r
+_Set in: GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `\s` and `\S` whitespace-matching metacharacters.\r
+\r
+The `\s` metacharacter in ASCII encoding is exactly equivalent to the character class\r
+`[\t\n\v\f\r ]`, or characters codes 9 through 13 (inclusive), and 32.\r
+\r
+The `\s` metacharacter in Unicode is exactly equivalent to the character class\r
+`[\t\n\v\f\r \x85\xA0\x1680\x2000-\x200A\x2028-\x2029\x202F\x205F\x3000]` — that is, it matches\r
+the same as ASCII, plus U+0085 (next line), U+00A0 (nonbreaking space), U+1680 (Ogham space mark),\r
+U+2000 (en quad) through U+200A (hair space) (this range includes several widths of Unicode spaces),\r
+U+2028 (line separator) through U+2029 (paragraph separator),\r
+U+202F (narrow no-break space), U+205F (medium mathematical space), and U+3000 (CJK ideographic space).\r
+\r
+All non-Unicode encodings are handled by converting their code points to the appropriate\r
+Unicode-equivalent code points, and then matching according to Unicode rules.\r
+\r
+`\S` always matches any one character that is _not_ in the set matched by `\s`.\r
+\r
+\r
+### 22. ONIG_SYN_OP_ESC_D_DIGIT (enable `\d` and `\D`)\r
+\r
+_Set in: GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `\d` and `\D` digit-matching metacharacters.\r
+\r
+The `\d` metacharacter in ASCII encoding is exactly equivalent to the character class\r
+`[0-9]`, or characters codes 48 through 57 (inclusive).\r
+\r
+The `\d` metacharacter in Unicode matches `[0-9]`, as well as digits in Arabic, Devanagari,\r
+Bengali, Laotian, Mongolian, CJK fullwidth numerals, and many more.\r
+\r
+All non-Unicode encodings are handled by converting their code points to the appropriate\r
+Unicode-equivalent code points, and then matching according to Unicode rules.\r
+\r
+`\D` always matches any one character that is _not_ in the set matched by `\d`.\r
+\r
+\r
+### 23. ONIG_SYN_OP_LINE_ANCHOR (enable `^r` and `r$`)\r
+\r
+_Set in: Emacs, Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the common `^` and `$` line-anchor metacharacters.\r
+\r
+In single-line mode, `^` matches the start of the input buffer, and `$` matches\r
+the end of the input buffer.  In multi-line mode, `^` matches if the preceding\r
+character is `\n`; and `$` matches if the following character is `\n`.\r
+\r
+(Note that Oniguruma does not recognize other newline types:  It only matches\r
+`^` and `$` against `\n`:  not `\r`, not `\r\n`, not the U+2028 line separator,\r
+and not any other form.)\r
+\r
+\r
+### 24. ONIG_SYN_OP_POSIX_BRACKET (enable POSIX `[:xxxx:]`)\r
+\r
+_Set in: PosixBasic, PosixExtended, Grep, GnuRegex, Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the POSIX `[:xxxx:]` character classes, like `[:alpha:]` and `[:digit:]`.\r
+The supported POSIX character classes are `alnum`, `alpha`, `blank`, `cntrl`, `digit`,\r
+`graph`, `lower`, `print`, `punct`, `space`, `upper`, `xdigit`, `ascii`, `word`.\r
+\r
+\r
+### 25. ONIG_SYN_OP_QMARK_NON_GREEDY (enable `r??`, `r*?`, `r+?`, and `r{n,m}?`)\r
+\r
+_Set in: Perl, Java, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for lazy (non-greedy) quantifiers: That is, if you append a `?` after\r
+another quantifier such as `?`, `*`, `+`, or `{n,m}`, Oniguruma will try to match\r
+as _little_ as possible instead of as _much_ as possible.\r
+\r
+\r
+### 26. ONIG_SYN_OP_ESC_CONTROL_CHARS (enable `\n`, `\r`, `\t`, etc.)\r
+\r
+_Set in: PosixBasic, PosixExtended, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for C-style control-code escapes, like `\n` and `\r`.  Specifically,\r
+this recognizes `\a` (7), `\b` (8), `\t` (9), `\n` (10), `\f` (12), `\r` (13), and\r
+`\e` (27).  If ONIG_SYN_OP2_ESC_V_VTAB is enabled (see below), this also enables\r
+support for recognizing `\v` as code point 11.\r
+\r
+\r
+### 27. ONIG_SYN_OP_ESC_C_CONTROL (enable `\cx` control codes)\r
+\r
+_Set in: Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for named control-code escapes, like `\cm` or `\cM` for code-point\r
+13.  In this shorthand form, control codes may be specified by `\c` (for "Control")\r
+followed by an alphabetic letter, a-z or A-Z, indicating which code point to represent\r
+(1 through 26).  So `\cA` is code point 1, and `\cZ` is code point 26.\r
+\r
+\r
+### 28. ONIG_SYN_OP_ESC_OCTAL3 (enable `\OOO` octal codes)\r
+\r
+_Set in: Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for octal-style escapes of up to three digits, like `\1` for code\r
+point 1, and `\177` for code point 127.  Octal values greater than 255 will result\r
+in an error message.\r
+\r
+\r
+### 29. ONIG_SYN_OP_ESC_X_HEX2 (enable `\xHH` hex codes)\r
+\r
+_Set in: Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for hexadecimal-style escapes of up to two digits, like `\x1` for code\r
+point 1, and `\x7F` for code point 127.\r
+\r
+\r
+### 30. ONIG_SYN_OP_ESC_X_BRACE_HEX8 (enable `\x{7HHHHHHH}` hex codes)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for brace-wrapped hexadecimal-style escapes of up to eight digits,\r
+like `\x{1}` for code point 1, and `\x{FFFE}` for code point 65534.\r
+\r
+\r
+### 31. ONIG_SYN_OP_ESC_O_BRACE_OCTAL (enable `\o{1OOOOOOOOOO}` octal codes)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for brace-wrapped octal-style escapes of up to eleven digits,\r
+like `\o{1}` for code point 1, and `\o{177776}` for code point 65534.\r
+\r
+(New feature as of Oniguruma 6.3.)\r
+\r
+\r
+----------\r
+\r
+\r
+## Group Two Flags (op2)\r
+\r
+\r
+This group contains support for lesser-known regex syntax constructs.\r
+\r
+\r
+### 0. ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (enable `\Q...\E`)\r
+\r
+_Set in: Java, Perl, Perl_NG_\r
+\r
+Enables support for "quoted" parts of a pattern:  Between `\Q` and `\E`, all\r
+syntax parsing is turned off, so that metacharacters like `*` and `+` will no\r
+longer be treated as metacharacters, and instead will be matched as literal\r
+`*` and `+`, as if they had been escaped with `\*` and `\+`.\r
+\r
+\r
+### 1. ONIG_SYN_OP2_QMARK_GROUP_EFFECT (enable `(?...)`)\r
+\r
+_Set in: Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for the fairly-common `(?...)` grouping operator, which\r
+controls precedence but which does _not_ capture its contents.\r
+\r
+\r
+### 2. ONIG_SYN_OP2_OPTION_PERL (enable options `(?imsx)` and `(?-imsx)`)\r
+\r
+_Set in: Java, Perl, Perl_NG_\r
+\r
+Enables support for changing regex options in the middle of a regex:  So\r
+`a(?i)b` can be used to turn on case-insensitivity after matching `a` but\r
+before matching `b`, while `a(?-i)b` will turn off case-insensitivity in\r
+the same location.  The supported toggle-able options for this flag are:\r
+\r
+  - `i` - Case-insensitivity\r
+  - `m` - Multi-line mode (`^` and `$` match at `\n` as well as start/end of buffer)\r
+  - `s` - Single-line mode (`.` can match `\n`)\r
+  - `x` - Extended pattern (free-formatting: whitespace will ignored)\r
+\r
+\r
+### 3. ONIG_SYN_OP2_OPTION_RUBY (enable options `(?imx)` and `(?-imx)`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for changing regex options in the middle of a regex:  So\r
+`a(?i)b` can be used to turn on case-insensitivity after matching `a` but\r
+before matching `b`, while `a(?-i)b` will turn off case-insensitivity in\r
+the same location.  The supported toggle-able options for this flag are:\r
+\r
+  - `i` - Case-insensitivity\r
+  - `m` - Multi-line mode (`^` and `$` match at `\n` as well as start/end of buffer)\r
+  - `x` - Extended pattern (free-formatting: whitespace will ignored)\r
+\r
+\r
+### 4. ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (enable `r?+`, `r*+`, and `r++`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for the _possessive_ quantifiers `?+`, `*+`, and `++`, which\r
+work similarly to `?` and `*` and `+`, respectively, but which do not backtrack\r
+after matching:  Like the normal greedy quantifiers, they match as much as\r
+possible, but they do not attempt to match _less_ than their maximum possible\r
+extent if subsequent parts of the pattern fail to match.\r
+\r
+\r
+### 5. ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (enable `r{n,m}+`)\r
+\r
+_Set in: Java_\r
+\r
+Enables support for the _possessive_ quantifier `{n,m}+`, which\r
+works similarly to `{n,m}`, but which does not backtrack\r
+after matching:  Like the normal greedy quantifier, it matches as much as\r
+possible, but it do not attempt to match _less_ than its maximum possible\r
+extent if subsequent parts of the pattern fail to match.\r
+\r
+\r
+### 6. ONIG_SYN_OP2_CCLASS_SET_OP (enable `&&` within `[...]`)\r
+\r
+_Set in: Java, Ruby, Oniguruma_\r
+\r
+Enables support for character-class _intersection_.  For example, with this\r
+feature enabled, you can write `[a-z&&[^aeiou]]` to produce a character class\r
+of only consonants, or `[\0-\37&&[^\n\r]]` to produce a character class of\r
+all control codes _except_ newlines.\r
+\r
+\r
+### 7. ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (enable named captures `(?<name>...)`)\r
+\r
+_Set in: Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for _naming_ capture groups, so that instead of having to\r
+refer to captures by position (like `\3` or `$3`), you can refer to them by names\r
+(like `server` and `path`).  This supports the Perl/Ruby naming syntaxes `(?<name>...)`\r
+and `(?'name'...)`, but not the Python `(?P<name>...)` syntax.\r
+\r
+\r
+### 8. ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (enable named backreferences `\k<name>`)\r
+\r
+_Set in: Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for substituted backreferences by name, not just by position.\r
+This supports using `\k'name'` in addition to supporting `\k<name>`.  This also\r
+supports an Oniguruma-specific extension that lets you specify the _distance_ of\r
+the match, if the capture matched multiple times, by writing `\k<name+n>` or\r
+`\k<name-n>`.\r
+\r
+\r
+### 9. ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (enable backreferences `\g<name>` and `\g<n>`)\r
+\r
+_Set in: Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for substituted backreferences by both name and position using\r
+the same syntax.  This supports using `\g'name'` and `\g'1'` in addition to\r
+supporting `\g<name>` and `\g<1>`.\r
+\r
+\r
+### 10. ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (enable `(?@...)` and `(?@<name>...)`)\r
+\r
+_Set in: none_\r
+\r
+Enables support for _capture history_, which can answer via the `onig_*capture*()`\r
+functions exactly which captures were matched, how many times, and where in the\r
+input they were matched, by placing `?@` in front of the capture.  Per Oniguruma's\r
+regex syntax documentation (appendix A-5):\r
+\r
+`/(?@a)*/.match("aaa")` ==> `[<0-1>, <1-2>, <2-3>]`\r
+\r
+This can require substantial memory, is primarily useful for debugging, and is not\r
+enabled by default in any syntax.\r
+\r
+\r
+### 11. ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (enable `\C-x`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for Ruby legacy control-code escapes, like `\C-m` or `\C-M` for code-point\r
+13.  In this shorthand form, control codes may be specified by `\C-` (for "Control")\r
+followed by a single character (or equivalent), indicating which code point to represent,\r
+based on that character's lowest five bits.  So, like `\c`, you can represent code-point\r
+10 with `\C-j`, but you can also represent it with `\C-*` as well.\r
+\r
+See also ONIG_SYN_OP_ESC_C_CONTROL, which enables the more-common `\cx` syntax.\r
+\r
+\r
+### 12. ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (enable `\M-x`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for Ruby legacy meta-code escapes.  When you write `\M-x`, Oniguruma\r
+will match an `x` whose 8th bit is set (i.e., the character code of `x` will be or'ed\r
+with `0x80`).  So, for example, you can match `\x81` using `\x81`, or you can write\r
+`\M-\1`.  This is mostly useful when working with legacy 8-bit character encodings.\r
+\r
+\r
+### 13. ONIG_SYN_OP2_ESC_V_VTAB (enable `\v` as vertical tab)\r
+\r
+_Set in: Java, Ruby, Oniguruma_\r
+\r
+Enables support for a C-style `\v` escape code, meaning "vertical tab."  If enabled,\r
+`\v` will be equivalent to ASCII code point 11.\r
+\r
+\r
+### 14. ONIG_SYN_OP2_ESC_U_HEX4 (enable `\uHHHH` for Unicode)\r
+\r
+_Set in: Java, Ruby, Oniguruma_\r
+\r
+Enables support for a Java-style `\uHHHH` escape code for representing Unicode\r
+code-points by number, using up to four hexadecimal digits (up to `\uFFFF`).  So,\r
+for example, `\u221E` will match an infinity symbol, `∞`.\r
+\r
+For code points larger than four digits, like the emoji `🚡` (aerial tramway, or code\r
+point U+1F6A1), you must either represent the character directly using an encoding like\r
+UTF-8, or you must enable support for ONIG_SYN_OP_ESC_X_BRACE_HEX8 or\r
+ONIG_SYN_OP_ESC_O_BRACE_OCTAL, which support more than four digits.\r
+\r
+(New feature as of Oniguruma 6.7.)\r
+\r
+\r
+### 15. ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (enable ``\` `` and `\'` anchors)\r
+\r
+_Set in: Emacs_\r
+\r
+This flag makes the ``\` `` and `\'` escapes function identically to\r
+`\A` and `\z`, respectively (when ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR is enabled).\r
+\r
+These anchor forms are very obscure, and rarely supported by other regex libraries.\r
+\r
+\r
+### 16. ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (enable `\p{...}` and `\P{...}`)\r
+\r
+_Set in: Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for an alternate syntax for POSIX character classes; instead of\r
+writing `[:alpha:]` when this is enabled, you can instead write `\p{alpha}`.\r
+\r
+See also ONIG_SYN_OP_POSIX_BRACKET for the classic POSIX form.\r
+\r
+\r
+### 17. ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (enable `\p{^...}` and `\P{^...}`)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for an alternate syntax for POSIX character classes; instead of\r
+writing `[:^alpha:]` when this is enabled, you can instead write `\p{^alpha}`.\r
+\r
+See also ONIG_SYN_OP_POSIX_BRACKET for the classic POSIX form.\r
+\r
+\r
+### 18. ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS\r
+\r
+_(not presently used)_\r
+\r
+\r
+### 19. ONIG_SYN_OP2_ESC_H_XDIGIT (enable `\h` and `\H`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for the Ruby-specific shorthand `\h` and `\H` metacharacters.\r
+Somewhat like `\d` matches decimal digits, `\h` matches hexadecimal digits — that is,\r
+characters in `[0-9a-fA-F]`.\r
+\r
+`\H` matches the opposite of whatever `\h` matches.\r
+\r
+\r
+### 20. ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (disable `\`)\r
+\r
+_Set in: As-is_\r
+\r
+If set, this disables all escape codes, shorthands, and metacharacters that start\r
+with `\` (or whatever the configured escape character is), allowing `\` to be treated\r
+as a literal `\`.\r
+\r
+You usually do not want this flag to be enabled.\r
+\r
+\r
+### 21. ONIG_SYN_OP2_QMARK_LPAREN_IF_ELSE (enable `(?(...)then|else)`)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for conditional inclusion of subsequent regex patterns based on whether\r
+a prior named or numbered capture matched, or based on whether a lookhead pattern will\r
+match.  This supports many different forms, including:\r
+\r
+  - `(?(foo)then|else)` - condition based on a capture by name.\r
+  - `(?(<foo>)then|else)` - condition based on a capture by name.\r
+  - `(?('foo')then|else)` - condition based on a capture by name.\r
+  - `(?(3)then|else)` - condition based on a capture by number.\r
+  - `(?(+3)then|else)` - forward conditional to a future match, by relative position.\r
+  - `(?(-3)then|else)` - backward conditional to a prior match, by relative position.\r
+  - `(?(foo)then|else)` - if there is no capture named `foo`, this matches a literal pattern `foo` as lookahead.\r
+\r
+(New feature as of Oniguruma 6.5.)\r
+\r
+\r
+### 22. ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (enable `\K`)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for `\K`, which excludes all content before it from the overall\r
+regex match (i.e., capture #0).  So, for example, pattern `foo\Kbar` would match\r
+`foobar`, but capture #0 would only include `bar`.\r
+\r
+(New feature as of Oniguruma 6.5.)\r
+\r
+\r
+### 23. ONIG_SYN_OP2_ESC_CAPITAL_R_GENERAL_NEWLINE (enable `\R`)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Enables support for `\R`, the "general newline" shorthand, which matches\r
+`(\r\n|[\n\v\f\r\u0085\u2028\u2029])` (obviously, the Unicode values are cannot be\r
+matched in ASCII encodings).\r
+\r
+(New feature as of Oniguruma 6.5.)\r
+\r
+\r
+### 24. ONIG_SYN_OP2_ESC_CAPITAL_N_O_SUPER_DOT (enable `\N` and `\O`)\r
+\r
+_Set in: Perl, Perl_NG, Oniguruma_\r
+\r
+Enables support for `\N` and `\O`.  `\N` is "not a line break," which is much\r
+like the standard `.` metacharacter, except that while `.` can be affected by\r
+the single-line setting, `\N` always matches exactly one character that is not\r
+one of the various line-break characters (like `\n` and `\r`).\r
+\r
+`\O` matches exactly one character, regardless of whether single-line or\r
+multi-line mode are enabled or disabled.\r
+\r
+(New feature as of Oniguruma 6.5.)\r
+\r
+\r
+### 25. ONIG_SYN_OP2_QMARK_TILDE_ABSENT_GROUP (enable `(?~...)`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+Enables support for the `(?~r)` "absent operator" syntax, which matches\r
+as much as possible as long as the result _doesn't_ match pattern `r`.  This is\r
+_not_ the same as negative lookahead or negative lookbehind.\r
+\r
+Among the most useful examples of this is `\/\*(?~\*\/)\*\/`, which matches\r
+C-style comments by simply saying "starts with /*, ends with */, and _doesn't_\r
+contain a */ in between."\r
+\r
+A full explanation of this feature is complicated, but it is useful, and an\r
+excellent article about it is [available on Medium](https://medium.com/rubyinside/the-new-absent-operator-in-ruby-s-regular-expressions-7c3ef6cd0b99).\r
+\r
+(New feature as of Oniguruma 6.5.)\r
+\r
+\r
+### 26. ONIG_SYN_OP2_ESC_X_Y_GRAPHEME_CLUSTER (enable `\X` and `\Y` and `\y`)\r
+\r
+_Set in: Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+`\X` is another variation on `.`, designed to support Unicode, in that it matches\r
+a full _grapheme cluster_.  In Unicode, `à` can be encoded as one code point,\r
+`U+00E0`, or as two, `U+0061 U+0300`.  If those are further escaped using UTF-8,\r
+the former becomes two bytes, and the latter becomes three.  Unfortunately, `.`\r
+would naively match only one or two bytes, depending on the encoding, and would\r
+likely incorrectly match anything from just `a` to a broken half of a code point.\r
+`\X` is designed to fix this:  It matches the full `à`, no matter how `à` is\r
+encoded or decomposed.\r
+\r
+`\X` will _not_ match a newline.\r
+\r
+`\y` matches a cluster boundary, i.e., a zero-width position between\r
+graphemes, somewhat like `\b` matches boundaries between words.  `\Y` matches\r
+the _opposite_ of `\y`, that is, a zero-width position between code points in\r
+the _middle_ of a grapheme.\r
+\r
+(New feature as of Oniguruma 6.6.)\r
+\r
+\r
+### 27. ONIG_SYN_OP2_QMARK_PERL_SUBEXP_CALL (enable `(?R)` and `(?&name)`)\r
+\r
+_Set in: Perl_NG_\r
+\r
+Enables support for substituted backreferences by both name and position using\r
+Perl-5-specific syntax.  This supports using `(?R3)` and `(?&name)` to reference\r
+previous (and future) matches, similar to the more-common `\g<3>` and `\g<name>`\r
+backreferences.\r
+\r
+(New feature as of Oniguruma 6.7.)\r
+\r
+\r
+### 28. ONIG_SYN_OP2_QMARK_BRACE_CALLOUT_CONTENTS (enable `(?{...})`)\r
+\r
+_Set in: Perl, Perl_NG, Oniguruma_\r
+\r
+Enables support for Perl-style "callouts" — pattern substitutions that result from\r
+invoking a callback method.  When `(?{foo})` is reached in a pattern, the callback\r
+function set in `onig_set_progress_callout()` will be invoked, and be able to perform\r
+custom computation during the pattern match (and during backtracking).\r
+\r
+Full documentation for this advanced feature can be found in the Oniguruma\r
+`docs/CALLOUT.md` file, with an example in `samples/callout.c`.\r
+\r
+(New feature as of Oniguruma 6.8.)\r
+\r
+\r
+### 29. ONIG_SYN_OP2_ASTERISK_CALLOUT_NAME (enable `(*name)`)\r
+\r
+_Set in: Perl, Perl_NG, Oniguruma_\r
+\r
+Enables support for Perl-style "callouts" — pattern substitutions that result from\r
+invoking a callback method.  When `(*foo)` is reached in a pattern, the callback\r
+function set in `onig_set_callout_of_name()` will be invoked, passing the given name\r
+`foo` to it, and it can perform custom computation during the pattern match (and\r
+during backtracking).\r
+\r
+Full documentation for this advanced feature can be found in the Oniguruma\r
+`docs/CALLOUT.md` file, with an example in `samples/callout.c`.\r
+\r
+(New feature as of Oniguruma 6.8.)\r
+\r
+\r
+----------\r
+\r
+\r
+## Syntax Flags (syn)\r
+\r
+\r
+This group contains rules to handle corner cases and constructs that are errors in\r
+some syntaxes but not in others.\r
+\r
+### 0. ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (independent `?`, `*`, `+`, `{n,m}`)\r
+\r
+_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+This flag specifies how to handle operators like `?` and `*` when they aren't\r
+directly attached to an operand, as in `^*` or `(*)`:  Are they an error, are\r
+they discarded, or are they taken as literals?  If this flag is clear, they\r
+are taken as literals; otherwise, the ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS flag\r
+determines if they are errors or if they are discarded.\r
+\r
+### 1. ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (error or ignore independent operators)\r
+\r
+_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+If ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS is set, this flag controls what happens when\r
+independent operators appear in a pattern:  If this flag is set, then independent\r
+operators produce an error message; if this flag is clear, then independent\r
+operators are silently discarded.\r
+\r
+### 2. ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (allow `...)...`)\r
+\r
+_Set in: PosixExtended_\r
+\r
+This flag, if set, causes a `)` character without a preceding `(` to be treated as\r
+a literal `)`, equivalent to `\)`.  If this flag is clear, then an unmatched `)`\r
+character will produce an error message.\r
+\r
+### 3. ONIG_SYN_ALLOW_INVALID_INTERVAL (allow `{???`)\r
+\r
+_Set in: GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+This flag, if set, causes an invalid range, like `foo{bar}` or `foo{}`, to be\r
+silently discarded, as if `foo` had been written instead.  If clear, an invalid\r
+range will produce an error message.\r
+\r
+### 4. ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (allow `{,n}` to mean `{0,n}`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+If this flag is set, then `r{,n}` will be treated as equivalent to writing\r
+`{0,n}`.  If this flag is clear, then `r{,n}` will produce an error message.\r
+\r
+Note that regardless of whether this flag is set or clear, if\r
+ONIG_SYN_OP_BRACE_INTERVAL is enabled, then `r{n,}` will always be legal:  This\r
+flag *only* controls the behavior of the opposite form, `r{,n}`.\r
+\r
+### 5. ONIG_SYN_STRICT_CHECK_BACKREF (error on invalid backrefs)\r
+\r
+_Set in: none_\r
+\r
+If this flag is set, an invalid backref, like `\1` in a pattern with no captures,\r
+will produce an error.  If this flag is clear, then an invalid backref will be\r
+equivalent to the empty string.\r
+\r
+No built-in syntax has this flag enabled.\r
+\r
+### 6. ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (allow `(?<=a|bc)`)\r
+\r
+_Set in: Java, Ruby, Oniguruma_\r
+\r
+If this flag is set, lookbehind patterns with alternate options may have differing\r
+lengths among those options.  If this flag is clear, lookbehind patterns with options\r
+must have each option have identical length to the other options.\r
+\r
+Oniguruma can handle either form, but not all regex engines can, so for compatibility,\r
+Oniguruma allows you to cause regexes for other regex engines to fail if they might\r
+depend on this rule.\r
+\r
+### 7. ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (prefer `\k<name>` over `\3`)\r
+\r
+_Set in: Perl_NG, Ruby, Oniguruma_\r
+\r
+If this flag is set on the syntax *and* ONIG_OPTION_CAPTURE_GROUP is set when calling\r
+Oniguruma, then if a name is used on any capture, all captures must also use names:  A\r
+single use of a named capture prohibits the use of numbered captures.\r
+\r
+### 8. ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (allow `(?<x>)...(?<x>)`)\r
+\r
+_Set in: Perl_NG, Ruby, Oniguruma_\r
+\r
+If this flag is set, multiple capture groups may use the same name.  If this flag is\r
+clear, then reuse of a name will produce an error message.\r
+\r
+### 9. ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (`a{n}?` is equivalent to `(?:a{n})?`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+If this flag is set, then intervals of a fixed size will ignore a lazy (non-greedy)\r
+`?` quantifier and treat it as an optional match (an ordinary `r?`), since "match as\r
+little as possible" is meaningless for a fixed-size interval.  If this flag is clear,\r
+then `r{n}?` will mean the same as `r{n}`, and the useless `?` will be discarded.\r
+\r
+### 20. ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (add `\n` to `[^...]`)\r
+\r
+_Set in: Grep_\r
+\r
+If this flag is set, all newline characters (like `\n`) will be excluded from a negative\r
+character class automatically, as if the pattern had been written as `[^...\n]`.  If this\r
+flag is clear, negative character classes do not automatically exclude newlines, and\r
+only exclude those characters and ranges written in them.\r
+\r
+### 21. ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (allow `[...\w...]`)\r
+\r
+_Set in: GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+If this flag is set, shorthands like `\w` are allowed to describe characters in character\r
+classes.  If this flag is clear, shorthands like `\w` are treated as a redundantly-escaped\r
+literal `w`.\r
+\r
+### 22. ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (silently discard `[z-a]`)\r
+\r
+_Set in: Emacs, Grep_\r
+\r
+If this flag is set, then character ranges like `[z-a]` that are broken or contain no\r
+characters will be silently ignored.  If this flag is clear, then broken or empty\r
+character ranges will produce an error message.\r
+\r
+### 23. ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (treat `[0-9-a]` as `[0-9\-a]`)\r
+\r
+_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+If this flag is set, then a trailing `-` after a character range will be taken as a\r
+literal `-`, as if it had been escaped as `\-`.  If this flag is clear, then a trailing\r
+`-` after a character range will produce an error message.\r
+\r
+### 24. ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (warn on `[[...]` and `[-x]`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+If this flag is set, Oniguruma will be stricter about warning for bad forms in\r
+character classes:  `[[...]` will produce a warning, but `[\[...]` will not;\r
+`[-x]` will produce a warning, but `[\-x]` will not; `[x&&-y]` will produce a warning,\r
+while `[x&&\-y]` will not; and so on.  If this flag is clear, all of these warnings\r
+will be silently discarded.\r
+\r
+### 25. ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (warn on `(?:a*)+`)\r
+\r
+_Set in: Ruby, Oniguruma_\r
+\r
+If this flag is set, Oniguruma will warn about nested repeat operators that may cause\r
+significant performance problems, like `(?:a*)+`, which has extremely poor _O(n²)_ growth\r
+and may take an extremely long time to match.  If this flag is clear, Oniguruma will\r
+allow the nested repeat operators without warning about them.\r
+\r
+### 31. ONIG_SYN_CONTEXT_INDEP_ANCHORS\r
+\r
+_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_\r
+\r
+Not currently used, and does nothing.  (But still set in several syntaxes for some\r
+reason.)\r
+\r
+----------\r
+\r
+## Usage tables\r
+\r
+These tables show which of the built-in syntaxes use which flags and options, for easy comparison between them.\r
+\r
+### Group One Flags (op)\r
+\r
+| ID    | Option                                        | PosB  | PosEx | Emacs | Grep  | Gnu   | Java  | Perl  | PeNG  | Ruby  | Onig  |\r
+| ----- | --------------------------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |\r
+| 0     | `ONIG_SYN_OP_VARIABLE_META_CHARACTERS`        | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 1     | `ONIG_SYN_OP_DOT_ANYCHAR`                     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 2     | `ONIG_SYN_OP_ASTERISK_ZERO_INF`               | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 3     | `ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF`           | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 4     | `ONIG_SYN_OP_PLUS_ONE_INF`                    | -     | Yes   | Yes   | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 5     | `ONIG_SYN_OP_ESC_PLUS_ONE_INF`                | -     | -     | -     | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 6     | `ONIG_SYN_OP_QMARK_ZERO_ONE`                  | -     | Yes   | Yes   | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 7     | `ONIG_SYN_OP_ESC_QMARK_ZERO_ONE`              | -     | -     | -     | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 8     | `ONIG_SYN_OP_BRACE_INTERVAL`                  | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 9     | `ONIG_SYN_OP_ESC_BRACE_INTERVAL`              | Yes   | -     | Yes   | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 10    | `ONIG_SYN_OP_VBAR_ALT`                        | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 11    | `ONIG_SYN_OP_ESC_VBAR_ALT`                    | -     | -     | Yes   | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 12    | `ONIG_SYN_OP_LPAREN_SUBEXP`                   | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 13    | `ONIG_SYN_OP_ESC_LPAREN_SUBEXP`               | Yes   | -     | Yes   | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 14    | `ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR`               | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 15    | `ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR`      | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 16    | `ONIG_SYN_OP_DECIMAL_BACKREF`                 | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 17    | `ONIG_SYN_OP_BRACKET_CC`                      | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 18    | `ONIG_SYN_OP_ESC_W_WORD`                      | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 19    | `ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END`         | -     | -     | -     | Yes   | Yes   | -     | -     | -     | -     | -     |\r
+| 20    | `ONIG_SYN_OP_ESC_B_WORD_BOUND`                | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 21    | `ONIG_SYN_OP_ESC_S_WHITE_SPACE`               | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 22    | `ONIG_SYN_OP_ESC_D_DIGIT`                     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 23    | `ONIG_SYN_OP_LINE_ANCHOR`                     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 24    | `ONIG_SYN_OP_POSIX_BRACKET`                   | Yes   | Yes   | Yes   | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 25    | `ONIG_SYN_OP_QMARK_NON_GREEDY`                | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 26    | `ONIG_SYN_OP_ESC_CONTROL_CHARS`               | Yes   | Yes   | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 27    | `ONIG_SYN_OP_ESC_C_CONTROL`                   | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 28    | `ONIG_SYN_OP_ESC_OCTAL3`                      | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 29    | `ONIG_SYN_OP_ESC_X_HEX2`                      | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 30    | `ONIG_SYN_OP_ESC_X_BRACE_HEX8`                | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 31    | `ONIG_SYN_OP_ESC_O_BRACE_OCTAL`               | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+\r
+### Group Two Flags (op2)\r
+\r
+| ID    | Option                                        | PosB  | PosEx | Emacs | Grep  | Gnu   | Java  | Perl  | PeNG  | Ruby  | Onig  |\r
+| ----- | --------------------------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |\r
+| 0     | `ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE`            | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | -     | -     |\r
+| 1     | `ONIG_SYN_OP2_QMARK_GROUP_EFFECT`             | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 2     | `ONIG_SYN_OP2_OPTION_PERL`                    | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | -     | -     |\r
+| 3     | `ONIG_SYN_OP2_OPTION_RUBY`                    | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 4     | `ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT`         | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 5     | `ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL`       | -     | -     | -     | -     | -     | Yes   | -     | -     | -     | -     |\r
+| 6     | `ONIG_SYN_OP2_CCLASS_SET_OP`                  | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 7     | `ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP`           | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 8     | `ONIG_SYN_OP2_ESC_K_NAMED_BACKREF`            | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 9     | `ONIG_SYN_OP2_ESC_G_SUBEXP_CALL`              | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 10    | `ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY`         | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 11    | `ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL`      | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 12    | `ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META`         | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 13    | `ONIG_SYN_OP2_ESC_V_VTAB`                     | -     | -     | -     | -     | -     | Yes   | -     | -     | Yes   | Yes   |\r
+| 14    | `ONIG_SYN_OP2_ESC_U_HEX4`                     | -     | -     | -     | -     | -     | Yes   | -     | -     | Yes   | Yes   |\r
+| 15    | `ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR`             | -     | -     | Yes   | -     | -     | -     | -     | -     | -     | -     |\r
+| 16    | `ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY`      | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 17    | `ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT`     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 18    | `ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS`        | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 19    | `ONIG_SYN_OP2_ESC_H_XDIGIT`                   | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 20    | `ONIG_SYN_OP2_INEFFECTIVE_ESCAPE`             | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 21    | `ONIG_SYN_OP2_QMARK_LPAREN_IF_ELSE`           | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 22    | `ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP`             | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 23    | `ONIG_SYN_OP2_ESC_CAPITAL_R_GENERAL_NEWLINE`  | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 24    | `ONIG_SYN_OP2_ESC_CAPITAL_N_O_SUPER_DOT`      | -     | -     | -     | -     | -     | -     | Yes   | Yes   | -     | Yes   |\r
+| 25    | `ONIG_SYN_OP2_QMARK_TILDE_ABSENT_GROUP`       | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 26    | `ONIG_SYN_OP2_ESC_X_Y_GRAPHEME_CLUSTER`       | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   |\r
+| 27    | `ONIG_SYN_OP2_QMARK_PERL_SUBEXP_CALL`         | -     | -     | -     | -     | -     | -     | -     | Yes   | -     | -     |\r
+| 28    | `ONIG_SYN_OP2_QMARK_BRACE_CALLOUT_CONTENTS`   | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | -     |\r
+| 29    | `ONIG_SYN_OP2_ASTERISK_CALLOUT_NAME`          | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   | -     |\r
+\r
+### Syntax Flags (syn)\r
+\r
+| ID    | Option                                        | PosB  | PosEx | Emacs | Grep  | Gnu   | Java  | Perl  | PeNG  | Ruby  | Onig  |\r
+| ----- | --------------------------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |\r
+| 0     | `ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS`           | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 1     | `ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS`         | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 2     | `ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP`       | -     | Yes   | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 3     | `ONIG_SYN_ALLOW_INVALID_INTERVAL`             | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 4     | `ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV`          | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 5     | `ONIG_SYN_STRICT_CHECK_BACKREF`               | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     |\r
+| 6     | `ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND`      | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 7     | `ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP`           | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 8     | `ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME`    | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   | Yes   |\r
+| 9     | `ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY`      | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 20    | `ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC`         | -     | -     | -     | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 21    | `ONIG_SYN_BACKSLASH_ESCAPE_IN_CC`             | -     | -     | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 22    | `ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC`            | -     | -     | Yes   | Yes   | -     | -     | -     | -     | -     | -     |\r
+| 23    | `ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC`        | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r
+| 24    | `ONIG_SYN_WARN_CC_OP_NOT_ESCAPED`             | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 25    | `ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT`       | -     | -     | -     | -     | -     | -     | -     | -     | Yes   | Yes   |\r
+| 31    | `ONIG_SYN_CONTEXT_INDEP_ANCHORS`              | -     | Yes   | -     | -     | Yes   | Yes   | Yes   | Yes   | Yes   | Yes   |\r