📄 glib-perl-compatible-regular-expressions.html
字号:
</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-TOO-MANY-CONDITIONAL-BRANCHES:CAPS"></a><code class="literal">G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES</code></span></p></td><td>Conditional group contains more than two branches. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-ASSERTION-EXPECTED:CAPS"></a><code class="literal">G_REGEX_ERROR_ASSERTION_EXPECTED</code></span></p></td><td>Assertion expected after "(?(". Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-UNKNOWN-POSIX-CLASS-NAME:CAPS"></a><code class="literal">G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME</code></span></p></td><td>Unknown POSIX class name. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-POSIX-COLLATING-ELEMENTS-NOT-SUPPORTED:CAPS"></a><code class="literal">G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED</code></span></p></td><td>POSIX collating elements are not supported. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-HEX-CODE-TOO-LARGE:CAPS"></a><code class="literal">G_REGEX_ERROR_HEX_CODE_TOO_LARGE</code></span></p></td><td>Character value in "\\x{...}" sequence is too large. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-INVALID-CONDITION:CAPS"></a><code class="literal">G_REGEX_ERROR_INVALID_CONDITION</code></span></p></td><td>Invalid condition "(?(0)". Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-SINGLE-BYTE-MATCH-IN-LOOKBEHIND:CAPS"></a><code class="literal">G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND</code></span></p></td><td>\\C not allowed in lookbehind assertion. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-INFINITE-LOOP:CAPS"></a><code class="literal">G_REGEX_ERROR_INFINITE_LOOP</code></span></p></td><td>Recursive call could loop indefinitely. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-MISSING-SUBPATTERN-NAME-TERMINATOR:CAPS"></a><code class="literal">G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR</code></span></p></td><td>Missing terminator in subpattern name. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-DUPLICATE-SUBPATTERN-NAME:CAPS"></a><code class="literal">G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME</code></span></p></td><td>Two named subpatterns have the same name. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-MALFORMED-PROPERTY:CAPS"></a><code class="literal">G_REGEX_ERROR_MALFORMED_PROPERTY</code></span></p></td><td>Malformed "\\P" or "\\p" sequence. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-UNKNOWN-PROPERTY:CAPS"></a><code class="literal">G_REGEX_ERROR_UNKNOWN_PROPERTY</code></span></p></td><td>Unknown property name after "\\P" or "\\p". Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-SUBPATTERN-NAME-TOO-LONG:CAPS"></a><code class="literal">G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG</code></span></p></td><td>Subpattern name is too long (maximum 32 characters). Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-TOO-MANY-SUBPATTERNS:CAPS"></a><code class="literal">G_REGEX_ERROR_TOO_MANY_SUBPATTERNS</code></span></p></td><td>Too many named subpatterns (maximum 10,000). Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-INVALID-OCTAL-VALUE:CAPS"></a><code class="literal">G_REGEX_ERROR_INVALID_OCTAL_VALUE</code></span></p></td><td>Octal value is greater than "\\377". Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-TOO-MANY-BRANCHES-IN-DEFINE:CAPS"></a><code class="literal">G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE</code></span></p></td><td>"DEFINE" group contains more than one branch. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-DEFINE-REPETION:CAPS"></a><code class="literal">G_REGEX_ERROR_DEFINE_REPETION</code></span></p></td><td>Repeating a "DEFINE" group is not allowed. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-INCONSISTENT-NEWLINE-OPTIONS:CAPS"></a><code class="literal">G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS</code></span></p></td><td>Inconsistent newline options. Since 2.16</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ERROR-MISSING-BACK-REFERENCE:CAPS"></a><code class="literal">G_REGEX_ERROR_MISSING_BACK_REFERENCE</code></span></p></td><td>"\\g" is not followed by a braced name or anoptionally braced non-zero number. Since 2.16</td></tr></tbody></table></div><p class="since">Since 2.14</p></div><hr><div class="refsect2" lang="en"><a name="id3145556"></a><h3><a name="G-REGEX-ERROR:CAPS"></a>G_REGEX_ERROR</h3><a class="indexterm" name="id3145572"></a><pre class="programlisting">#define G_REGEX_ERROR g_regex_error_quark ()</pre><p>Error domain for regular expressions. Errors in this domain will be from the <a class="link" href="glib-Perl-compatible-regular-expressions.html#GRegexError"><span class="type">GRegexError</span></a> enumeration. See <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for information on error domains.</p><p class="since">Since 2.14</p></div><hr><div class="refsect2" lang="en"><a name="id3145612"></a><h3><a name="GRegexCompileFlags"></a>enum GRegexCompileFlags</h3><a class="indexterm" name="id3145628"></a><pre class="programlisting">typedef enum{ G_REGEX_CASELESS = 1 << 0, G_REGEX_MULTILINE = 1 << 1, G_REGEX_DOTALL = 1 << 2, G_REGEX_EXTENDED = 1 << 3, G_REGEX_ANCHORED = 1 << 4, G_REGEX_DOLLAR_ENDONLY = 1 << 5, G_REGEX_UNGREEDY = 1 << 9, G_REGEX_RAW = 1 << 11, G_REGEX_NO_AUTO_CAPTURE = 1 << 12, G_REGEX_OPTIMIZE = 1 << 13, G_REGEX_DUPNAMES = 1 << 19, G_REGEX_NEWLINE_CR = 1 << 20, G_REGEX_NEWLINE_LF = 1 << 21, G_REGEX_NEWLINE_CRLF = G_REGEX_NEWLINE_CR | G_REGEX_NEWLINE_LF} GRegexCompileFlags;</pre><p>Flags specifying compile-time options.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="G-REGEX-CASELESS:CAPS"></a><code class="literal">G_REGEX_CASELESS</code></span></p></td><td>Letters in the pattern match both upper and lower caseletters. It be changed within a pattern by a "(?i)" option setting.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-MULTILINE:CAPS"></a><code class="literal">G_REGEX_MULTILINE</code></span></p></td><td>By default, GRegex treats the strings as consistingof a single line of characters (even if it actually contains newlines).The "start of line" metacharacter ("^") matches only at the start of thestring, while the "end of line" metacharacter ("$") matches only at theend of the string, or before a terminating newline (unless<a class="link" href="glib-Perl-compatible-regular-expressions.html#G-REGEX-DOLLAR-ENDONLY:CAPS"><span class="type">G_REGEX_DOLLAR_ENDONLY</span></a> is set). When <a class="link" href="glib-Perl-compatible-regular-expressions.html#G-REGEX-MULTILINE:CAPS"><span class="type">G_REGEX_MULTILINE</span></a> is set,the "start of line" and "end of line" constructs match immediately followingor immediately before any newline in the string, respectively, as wellas at the very start and end. This can be changed within a pattern by a"(?m)" option setting.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-DOTALL:CAPS"></a><code class="literal">G_REGEX_DOTALL</code></span></p></td><td>A dot metacharater (".") in the pattern matches allcharacters, including newlines. Without it, newlines are excluded. Thisoption can be changed within a pattern by a ("?s") option setting.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-EXTENDED:CAPS"></a><code class="literal">G_REGEX_EXTENDED</code></span></p></td><td>Whitespace data characters in the pattern aretotally 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 andthe next newline character, inclusive, are also ignored. This can bechanged within a pattern by a "(?x)" option setting.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-ANCHORED:CAPS"></a><code class="literal">G_REGEX_ANCHORED</code></span></p></td><td>The pattern is forced to be "anchored", that is,it is constrained to match only at the first matching point in the stringthat is being searched. This effect can also be achieved by appropriateconstructs in the pattern itself such as the "^" metacharater.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-DOLLAR-ENDONLY:CAPS"></a><code class="literal">G_REGEX_DOLLAR_ENDONLY</code></span></p></td><td>A dollar metacharacter ("$") in the patternmatches only at the end of the string. Without this option, a dollar alsomatches immediately before the final character if it is a newline (butnot before any other newlines). This option is ignored if<a class="link" href="glib-Perl-compatible-regular-expressions.html#G-REGEX-MULTILINE:CAPS"><span class="type">G_REGEX_MULTILINE</span></a> is set.</td></tr><tr><td><p><span class="term"><a name="G-REGEX-UNGREEDY:CAPS"></a><code class="literal">G_REGEX_UNGREEDY</code></span></p></td><td>Inverts the "greediness" of thequantifiers so that they are not greedy by default, but become greedyif followed by "?". It can also be set by a "(?U)" option setting within
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -