From 73d8439284f321b421200f07276df5f5d19d4408 Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Sun, 4 Aug 2024 17:20:00 -0700 Subject: [PATCH] Pass through regex docs Mainly turn code lists into tables --- docs/cpp2/metafunctions.md | 98 ++++++++++------ docs/index.md | 2 +- docs/notes/regex_status.md | 233 +++++++++++++++++++++++++++++++++++++ docs/other/regex_status.md | 211 --------------------------------- mkdocs.yml | 4 +- 5 files changed, 296 insertions(+), 252 deletions(-) create mode 100644 docs/notes/regex_status.md delete mode 100644 docs/other/regex_status.md diff --git a/docs/cpp2/metafunctions.md b/docs/cpp2/metafunctions.md index b60735834..b2d97ece1 100644 --- a/docs/cpp2/metafunctions.md +++ b/docs/cpp2/metafunctions.md @@ -360,26 +360,17 @@ main: () = { ``` -### Helpers and utilities - - -#### `cpp1_rule_of_zero` +### For computational and functional types -A `cpp1_rule_of_zero` type is one that has no user-written copy/move/destructor functions, and for which Cpp2 should generate nothing so that the Cpp1 defaults for generated special member functions are accepted. - -> C.20: If you can avoid defining default operations, do. -> Reason: It's the simplest and gives the cleanest semantics. -> This is known as "the rule of zero". -> — Stroustrup, Sutter, et al. (C++ Core Guidelines) #### `regex` -Replaces fields in the class with regular expression objects. All fields named `regex` or starting with `regex_` are replaced with a regular expression of the same type. +A `regex` type has data members that are regular expression objects. This metafunction replaces all of the type's data members named `regex` or `regex_*` with regular expression objects of the same type. For example: -``` cpp title="Regular expression example" +``` cpp title="Regular expression example" hl_lines="1 3 4 16 17 19 27 30 31" name_matcher: @regex type = { - regex := R"((\w+) (\w+))"; + regex := R"((\w+) (\w+))"; // for example: Margaret Hamilton regex_no_case := R"(/(ab)+/i)"; } @@ -391,48 +382,79 @@ main: (args) = { data = args[1]; } + // regex.match requires matches to start at the beginning the target string result := m.regex.match(data); if result.matched { - std::cout << "Hello (result.group(2))$, (result.group(1))$!" << std::endl; + // We found a match; reverse the order of the substrings + std::cout << "Hello (result.group(2))$, (result.group(1))$!\n"; } else { - std::cout << "I only know names of the form: ." << std::endl; + std::cout << "I only know names of the form: .\n"; } - std::cout << "Case insensitive match: " << m.regex_no_case.search("blubabABblah").group(0) << std::endl; + // regex.search finds a match anywhere within the target string + std::cout << "Case insensitive match: " + "(m.regex_no_case.search(\"blubabABblah\").group(0))$\n"; } +// Prints: +// Hello Duck, Donald! +// Case insensitive match: abAB ``` -The regex syntax used by cppfront is the [perl syntax](https://perldoc.perl.org/perlre). Most of the syntax is available. Currently we do not support unicode characters and the syntax tokens associated with them. In [supported features](../other/regex_status.md) all the available regex syntax is listed. +The `@regex` metafunction currently supports most of [Perl regex syntax](https://perldoc.perl.org/perlre), except for Unicode characters and the syntax tokens associated with them. See [Supported regular expression features](../notes/regex_status.md) for a list of regex options. + +Each regex object has the type `cpp2::regex::regular_expression`, which is defined in `include/cpp2regex.h2`. The member functions are: -The fields have the type `cpp2::regex::regular_expression`, which is defined in `include/cpp2regex.h2`. The member functions are ``` cpp title="Member functions for regular expressions" - match: (in this, str: std::string_view) -> search_return; - match: (in this, str: std::string_view, start) -> search_return; - match: (in this, str: std::string_view, start, length) -> search_return; - match: (in this, start: Iter, end: Iter) -> search_return; - - search: (in this, str: std::string_view) -> search_return; - search: (in this, str: std::string_view, start) -> search_return; - search: (in this, str: std::string_view, start, length) -> search_return; - search: (in this, start: Iter, end: Iter) -> search_return; +// .match() requires matches to start at the beginning the target string +// .search() finds a match anywhere within the target string + +match : (this, str: std::string_view) -> search_return; +search: (this, str: std::string_view) -> search_return; + +match : (this, str: std::string_view, start) -> search_return; +search: (this, str: std::string_view, start) -> search_return; + +match : (this, str: std::string_view, start, length) -> search_return; +search: (this, str: std::string_view, start, length) -> search_return; + +match : (this, start: Iter, end: Iter) -> search_return; +search: (this, start: Iter, end: Iter) -> search_return; ``` -The return type `search_return` is defined inside of `cpp2::regex::regular_expression` and has the fields/functions: -``` cpp title="Function and fields of a regular expression result." - matched: bool; - pos: int; +The return type `search_return` is defined in `cpp2::regex::regular_expression`. It has these members: + +``` cpp title="Members of a regular expression result" +matched: bool; +pos: int; - group_number: (this) -> size_t;; - group: (this, g: int) -> std::string; - group_start: (this, g: int) -> int; - group_end: (this, g: int) -> int; +// Functions to access groups by number +group_number: (this) -> size_t;; +group: (this, g: int) -> std::string; +group_start: (this, g: int) -> int; +group_end: (this, g: int) -> int; - group: (this, g: bstring) -> std::string; - group_start: (this, g: bstring) -> int; - group_end: (this, g: bstring) -> int; +// Functions to access groups by name +group: (this, g: bstring) -> std::string; +group_start: (this, g: bstring) -> int; +group_end: (this, g: bstring) -> int; ``` + + +### Helpers and utilities + + +#### `cpp1_rule_of_zero` + +A `cpp1_rule_of_zero` type is one that has no user-written copy/move/destructor functions, and for which Cpp2 should generate nothing so that the Cpp1 defaults for generated special member functions are accepted. + +> C.20: If you can avoid defining default operations, do. +> Reason: It's the simplest and gives the cleanest semantics. +> This is known as "the rule of zero". +> — Stroustrup, Sutter, et al. (C++ Core Guidelines) + + #### `print` `print` prints a pretty-printed visualization of the type to the console. diff --git a/docs/index.md b/docs/index.md index b903405c4..5a1f17704 100644 --- a/docs/index.md +++ b/docs/index.md @@ -32,7 +32,7 @@ We can't make an improvement that large to C++ via gradual evolution to today's ## What is cppfront? -[**Cppfront**](https://github.com/hsutter/cppfront) is a compiler that compiles Cpp2 syntax to today's Cpp1 syntax. This lets you start trying out Cpp2 syntax in any existing C++ project and build system just by renaming a source file from `.cpp` to `.cpp2` and [adding a build step](#adding-cppfront-in-your-ide-build-system), and the result Just Works with every C++20 or higher compiler and all existing C++ tools (debuggers, build systems, sanitizers, etc.). +[**Cppfront**](https://github.com/hsutter/cppfront) is a compiler that compiles Cpp2 syntax to today's Cpp1 syntax. This lets you start trying out Cpp2 syntax in any existing C++ project and build system just by renaming a source file from `.cpp` to `.cpp2` and [adding a build step](welcome/integration.md), and the result Just Works with every C++20 or higher compiler and all existing C++ tools (debuggers, build systems, sanitizers, etc.). This deliberately follows Bjarne Stroustrup's wise approach with [**cfront**](https://en.wikipedia.org/wiki/Cfront), the original C++ compiler: In the 1980s and 1990s, Stroustrup created cfront to translate C++ to pure C, and similarly ensured that C++ could be interleaved with C in the same source file, and that C++ could always call any C code with no wrapping/marshaling/thunking. By providing a C++ compiler that emitted pure C, Stroustrup ensured full compatibility with the C ecosystems that already existed, and made it easy for people to start trying out C++ code in any existing C project by adding just another build step to translate the C++ to C first, and the result Just Worked with existing C tools. diff --git a/docs/notes/regex_status.md b/docs/notes/regex_status.md new file mode 100644 index 000000000..14b44fa21 --- /dev/null +++ b/docs/notes/regex_status.md @@ -0,0 +1,233 @@ +# Supported regular expression features + +The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlre). Regular expressions are applied via the [`regex` metafunction](../cpp2/metafunctions.md#regex). + + +## Currently supported or planned features + + +### Modifiers + +| Modifier | Notes | Status | +| --- | --- | --- | +| **`i`** | Do case-insensitive pattern matching. For example, "A" will match "a" under `/i`. | Supported | +| **`m`** | Treat the string being matched against as multiple lines. That is, change `^` and `$` from matching the start of the string's first line and the end of its last line to matching the start and end of each line within the string. | Supported | +| **`s`** | Treat the string as single line. That is, change `.` to match any character whatsoever, even a newline, which normally it would not match. | Supported | +| ***`x` and `xx`** | Extend your pattern's legibility by permitting whitespace and comments. For details see: [Perl regex docs: `/x` and `/xx`](https://perldoc.perl.org/perlre#/x-and-/xx). | Supported | +| **`n`** | Prevent the grouping metacharacters `(` and `)` from capturing. This modifier will stop `$1`, `$2`, etc. from being filled in. | Supported | +| **`c`** | Keep the current position during repeated matching. | Planned | + + +### Escape sequences __(Complete)__ + +| Escape sequence | Notes | Status | +| --- | --- | --- | +| **`\t`** | Tab (HT, TAB)X | Supported | +| **`\n`** | Newline (LF, NL) | Supported | +| **`\r`** | Return (CR) | Supported | +| **`\f`** | Form feed (FF) | Supported | +| **`\a`** | Alarm (bell) (BEL) | Supported | +| **`\3`** | Escape (think troff) (ESC) | Supported | +| **`\x{}`, `\x00`** | Character whose ordinal is the given hexadecimal number | Supported | +| **`\o{}`, `\000`** | Character whose ordinal is the given octal number | Supported | + + +### Quantifiers __(Complete)__ + +| Quantifier | Notes | Status | +| --- | --- | --- | +| **`*`** | Match 0 or more times | Supported | +| **`+`** | Match 1 or more times | Supported | +| **`?`** | Match 1 or 0 times | Supported | +| **`{n}`** | Match exactly n times | Supported | +| **`{n,}`** | Match at least n times | Supported | +| **`{,n}`** | Match at most n times | Supported | +| **`{n,m}`** | Match at least n but not more than m times | Supported | +| | | | +| **`*?`** | Match 0 or more times, not greedily | Supported | +| **`+?`** | Match 1 or more times, not greedily | Supported | +| **`??`** | Match 0 or 1 time, not greedily | Supported | +| **`{n}?`** | Match exactly n times, not greedily (redundant) | Supported | +| **`{n,}?`** | Match at least n times, not greedily | Supported | +| **`{,n}?`** | Match at most n times, not greedily | Supported | +| **`{n,m}?`** | Match at least n but not more than m times, not greedily | Supported | +| | | | +| **`*+`** | Match 0 or more times and give nothing back | Supported | +| **`++`** | Match 1 or more times and give nothing back | Supported | +| **`?+`** | Match 0 or 1 time and give nothing back | Supported | +| **`{n}+`** | Match exactly n times and give nothing back (redundant) | Supported | +| **`{n,}+`** | Match at least n times and give nothing back | Supported | +| **`{,n}+`** | Match at most n times and give nothing back | Supported | +| **`{n,m}+`** | Match at least n but not more than m times and give nothing back | Supported | + + +### Character Classes and other Special Escapes __(Complete)__ + +| Feature | Notes | Status | +| --- | --- | --- | +| **`[`...`]`** | Match a character according to the rules of the bracketed character class defined by the "...". Example: `[a-z]` matches "a" or "b" or "c" ... or "z" | Supported | +| **`[[:`...`:]]`** | Match a character according to the rules of the POSIX character class "..." within the outer bracketed character class. Example: `[[:upper:]]` matches any uppercase character. | Supported | +| **`\g1`** or **`\g{-1}`** | Backreference to a specific or previous group. The number may be negative indicating a relative previous group and may optionally be wrapped in curly brackets for safer parsing. | Supported | +| **`\g{name}`** | Named backreference | Supported | +| **`\k`** | Named backreference | Supported | +| **`\k'name'`** | Named backreference | Supported | +| **`\k{name}`** | Named backreference | Supported | +| **`\w`** | Match a "word" character (alphanumeric plus "_", plus other connector punctuation chars plus Unicode marks) | Supported | +| **`\W`** | Match a non-"word" character | Supported | +| **`\s`** | Match a whitespace character | Supported | +| **`\S`** | Match a non-whitespace character | Supported | +| **`\d`** | Match a decimal digit character | Supported | +| **`\D`** | Match a non-digit character | Supported | +| **`\v`** | Vertical whitespace | Supported | +| **`\V`** | Not vertical whitespace | Supported | +| **`\h`** | Horizontal whitespace | Supported | +| **`\H`** | Not horizontal whitespace | Supported | +| **`\1`** | Backreference to a specific capture group or buffer. '1' may actually be any positive integer. | Supported | +| **`\N`** | Any character but \n. Not affected by /s modifier | Supported | +| **`\K`** | Keep the stuff left of the \K, don't include it in $& | Supported | + + +### Assertions + +| Assertion | Notes | Status | +| --- | --- | --- | +| **`\b`** | Match a \w\W or \W\w boundary | Supported | +| **`\B`** | Match except at a \w\W or \W\w boundary | Supported | +| **`\A`** | Match only at beginning of string | Supported | +| **`\Z`** | Match only at end of string, or before newline at the end | Supported | +| **`\z`** | Match only at end of string | Supported | +| **`\G`** | Match only at pos() (e.g. at the end-of-match position of prior m//g) | Planned | + + +### Capture groups __(Complete)__ + +| Feature | Status | +| --- | --- | +| **`(`...`)`** | Supported | + + +### Quoting metacharacters __(Complete)__ + +| Feature | Status | +| --- | --- | +| **For `^.[]$()*{}?+|\`** | Supported | + + +### Extended Patterns + +| Extended pattern | Notes | Status | +| --- | --- | --- | +| **`(?pattern)`** | Named capture group | Supported | +| **`(?#text)`** | Comments | Supported | +| **`(?adlupimnsx-imnsx)`** | Modification for surrounding context | Supported | +| **`(?^alupimnsx)`** | Modification for surrounding context | Supported | +| **`(?:pattern)`** | Clustering, does not generate a group index. | Supported | +| **`(?adluimnsx-imnsx:pattern)`** | Clustering, does not generate a group index and modifications for the cluster. | Supported | +| **`(?^aluimnsx:pattern)`** | Clustering, does not generate a group index and modifications for the cluster. | Supported | +| **`(?`|`pattern)`** | Branch reset | Supported | +| **`(?'NAME'pattern)`** | Named capture group | Supported | +| **`(?(condition)yes-pattern`|`no-pattern)`** | Conditional patterns. | Planned | +| **`(?(condition)yes-pattern)`** | Conditional patterns. | Planned | +| **`(?>pattern)`** | Atomic patterns. (Disable backtrack.) | Planned | +| **`(*atomic:pattern)`** | Atomic patterns. (Disable backtrack.) | Planned | + + +### Lookaround Assertions + +| Lookaround assertion | Notes | Status | +| --- | --- | --- | +| **`(?=pattern)`** | Positive look ahead. | Supported | +| **`(*pla:pattern)`** | Positive look ahead. | Supported | +| **`(*positive_lookahead:pattern)`** | Positive look ahead. | Supported | +| **`(?!pattern)`** | Negative look ahead. | Supported | +| **`(*nla:pattern)`** | Negative look ahead. | Supported | +| **`(*negative_lookahead:pattern)`** | Negative look ahead. | Supported | +| **`(?<=pattern)`** | Positive look behind. | Planned | +| **`(*plb:pattern)`** | Positive look behind. | Planned | +| **`(*positive_lookbehind:pattern)`** | Positive look behind. | Planned | +| **`(?Planned | +| **`(*nlb:pattern)`** | Negative look behind. | Planned | +| **`(*negative_lookbehind:pattern)`** | Negative look behind. | Planned | + + +### Special Backtracking Control Verbs + +| Backtracking control verb | Notes | Status | +| --- | --- | --- | +| **`(*SKIP) (*SKIP:NAME)`** | Start next search here. | Planned | +| **`(*PRUNE) (*PRUNE:NAME)`** | No backtracking over this point. | Planned | +| **`(*MARK:NAME) (*:NAME)`** | Place a named mark. | Planned | +| **`(*THEN) (*THEN:NAME)`** | Like PRUNE. | Planned | +| **`(*COMMIT) (*COMMIT:arg)`** | Stop searching. | Planned | +| **`(*FAIL) (*F) (*FAIL:arg)`** | Fail the pattern/branch. | Planned | +| **`(*ACCEPT) (*ACCEPT:arg)`** | Accept the pattern/subpattern. | Planned | + + +## Not planned (Mainly because of Unicode or perl specifics) + +### Modifiers + +| Modifier | Notes | Status | +| --- | --- | --- | +| `p` | Preserve the string matched such that ${^PREMATCH}, ${^MATCH}, and ${^POSTMATCH} are available for use after matching. | Not planned | +| `a`, `d`, `l`, and `u` | These modifiers affect which character-set rules (Unicode, etc.) are used, as described below in "Character set modifiers". | Not planned | +| `g` | globally match the pattern repeatedly in the string | Not planned | +| `e` | evaluate the right-hand side as an expression | Not planned | +| `ee` | evaluate the right side as a string then eval the result | Not planned | +| `o` | pretend to optimize your code, but actually introduce bugs | Not planned | +| `r` | perform non-destructive substitution and return the new value | Not planned | + + +### Escape sequences + +| Escape sequence | Notes | Status | +| --- | --- | --- | +| `\cK` | control char (example: VT) | Not planned | +| `\N{name}` | named Unicode character or character sequence | Not planned | +| `\N{U+263D}` | Unicode character (example: FIRST QUARTER MOON) | Not planned | +| `\l` | lowercase next char (think vi) | Not planned | +| `\u` | uppercase next char (think vi) | Not planned | +| `\L` | lowercase until \E (think vi) | Not planned | +| `\U` | uppercase until \E (think vi) | Not planned | +| `\Q` | quote (disable) pattern metacharacters until \E | Not planned | +| `\E` | end either case modification or quoted section, think vi | Not planned | + + +### Character Classes and other Special Escapes + +| Character class or escape | Notes | Status | +| --- | --- | --- | +| `(?[...])` | Extended bracketed character class | Not planned | +| `\pP` | Match P, named property. Use \p{Prop} for longer names | Not planned | +| `\PP` | Match non-P | Not planned | +| `\X` | Match Unicode "eXtended grapheme cluster" | Not planned | +| `\R` | Linebreak | Not planned | + + +### Assertions + +| Assertion | Notes | Status | +| --- | --- | --- | +| `\b{}` | Match at Unicode boundary of specified type | Not planned | +| `\B{}` | Match where corresponding \b{} doesn't match | Not planned | + +### Extended Patterns + + +| Extended pattern | Notes | Status | +| --- | --- | --- | +| `(?{ code })` | Perl code execution. | Not planned | +| `(*{ code })` | Perl code execution. | Not planned | +| `(??{ code })` | Perl code execution. | Not planned | +| `(?PARNO)` `(?-PARNO)` `(?+PARNO)` `(?R)` `(?0)` | Recursive subpattern. | Not planned | +| `(?&NAME)` | Recursive subpattern. | Not planned | + + +### Script runs + +| Script runs | Notes | Status | +| --- | --- | --- | +| `(*script_run:pattern)` | All chars in pattern need to be of the same script. | Not planned | +| `(*sr:pattern)` | All chars in pattern need to be of the same script. | Not planned | +| `(*atomic_script_run:pattern)` | Without backtracking. | Not planned | +| `(*asr:pattern)` | Without backtracking. | Not planned | diff --git a/docs/other/regex_status.md b/docs/other/regex_status.md deleted file mode 100644 index d87ddc7d0..000000000 --- a/docs/other/regex_status.md +++ /dev/null @@ -1,211 +0,0 @@ -# Supported regular expression features - -The listings are taken from [perl regex docs](https://perldoc.perl.org/perlre). Regular expressions are applied via [metafunctions](../cpp2/metafunctions.md#regex) - -## Current status and planned on doing - -### Modifiers -``` - - [x] i Do case-insensitive pattern matching. For example, "A" will match "a" under /i. - - [x] m Treat the string being matched against as multiple lines. That is, change "^" and "$" from matching the start of the string's first line and the end of its last line to matching the start and end of each line within the string. - - [x] s Treat the string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match. - - [x] x and xx Extend your pattern's legibility by permitting whitespace and comments. Details in "/x and /xx" - - [x] n Prevent the grouping metacharacters () from capturing. This modifier will stop $1, $2, etc... from being filled in. - - [ ] c keep the current position during repeated matching -``` - -### Escape sequences __(Complete)__ -``` - - [x] \t tab (HT, TAB) - - [x] \n newline (LF, NL) - - [x] \r return (CR) - - [x] \f form feed (FF) - - [x] \a alarm (bell) (BEL) - - [x] \e escape (think troff) (ESC) - - [x] \x{}, \x00 character whose ordinal is the given hexadecimal number - - [x] \o{}, \000 character whose ordinal is the given octal number - -``` - -### Quantifiers __(Complete)__ -``` - - [x] * Match 0 or more times - - [x] + Match 1 or more times - - [x] ? Match 1 or 0 times - - [x] {n} Match exactly n times - - [x] {n,} Match at least n times - - [x] {,n} Match at most n times - - [x] {n,m} Match at least n but not more than m times - - [x] *? Match 0 or more times, not greedily - - [x] +? Match 1 or more times, not greedily - - [x] ?? Match 0 or 1 time, not greedily - - [x] {n}? Match exactly n times, not greedily (redundant) - - [x] {n,}? Match at least n times, not greedily - - [x] {,n}? Match at most n times, not greedily - - [x] {n,m}? Match at least n but not more than m times, not greedily - - [x] *+ Match 0 or more times and give nothing back - - [x] ++ Match 1 or more times and give nothing back - - [x] ?+ Match 0 or 1 time and give nothing back - - [x] {n}+ Match exactly n times and give nothing back (redundant) - - [x] {n,}+ Match at least n times and give nothing back - - [x] {,n}+ Match at most n times and give nothing back - - [x] {n,m}+ Match at least n but not more than m times and give nothing back -``` - -### Character Classes and other Special Escapes __(Complete)__ -``` - - [x] [...] Match a character according to the rules of the - bracketed character class defined by the "...". - Example: [a-z] matches "a" or "b" or "c" ... or "z" - - [x] [[:...:]] Match a character according to the rules of the POSIX - character class "..." within the outer bracketed - character class. Example: [[:upper:]] matches any - uppercase character. - - [x] \g1 Backreference to a specific or previous group, - - [x] \g{-1} The number may be negative indicating a relative - previous group and may optionally be wrapped in - curly brackets for safer parsing. - - [x] \g{name} Named backreference - - [x] \k Named backreference - - [x] \k'name' Named backreference - - [x] \k{name} Named backreference - - [x] \w Match a "word" character (alphanumeric plus "_", plus - other connector punctuation chars plus Unicode - marks) - - [x] \W Match a non-"word" character - - [x] \s Match a whitespace character - - [x] \S Match a non-whitespace character - - [x] \d Match a decimal digit character - - [x] \D Match a non-digit character - - [x] \v Vertical whitespace - - [x] \V Not vertical whitespace - - [x] \h Horizontal whitespace - - [x] \H Not horizontal whitespace - - [x] \1 Backreference to a specific capture group or buffer. - '1' may actually be any positive integer. - - [x] \N Any character but \n. Not affected by /s modifier - - [x] \K Keep the stuff left of the \K, don't include it in $& -``` - -### Assertions -``` - - [x] \b Match a \w\W or \W\w boundary - - [x] \B Match except at a \w\W or \W\w boundary - - [x] \A Match only at beginning of string - - [x] \Z Match only at end of string, or before newline at the end - - [x] \z Match only at end of string - - [ ] \G Match only at pos() (e.g. at the end-of-match position - of prior m//g) -``` - -### Capture groups __(Complete)__ -``` - - [x] (...) -``` - -### Quoting metacharacters __(Complete)__ -``` - - [x] For ^.[]$()*{}?+|\ -``` - -### Extended Patterns -``` - - [x] (?pattern) Named capture group - - [x] (?#text) Comments - - [x] (?adlupimnsx-imnsx) Modification for surrounding context - - [x] (?^alupimnsx) Modification for surrounding context - - [x] (?:pattern) Clustering, does not generate a group index. - - [x] (?adluimnsx-imnsx:pattern) Clustering, does not generate a group index and modifications for the cluster. - - [x] (?^aluimnsx:pattern) Clustering, does not generate a group index and modifications for the cluster. - - [x] (?|pattern) Branch reset - - [x] (?'NAME'pattern) Named capture group - - [ ] (?(condition)yes-pattern|no-pattern) Conditional patterns. - - [ ] (?(condition)yes-pattern) Conditional patterns. - - [ ] (?>pattern) Atomic patterns. (Disable backtrack.) - - [ ] (*atomic:pattern) Atomic patterns. (Disable backtrack.) -``` - -### Lookaround Assertions -``` - - [x] (?=pattern) Positive look ahead. - - [x] (*pla:pattern) Positive look ahead. - - [x] (*positive_lookahead:pattern) Positive look ahead. - - [x] (?!pattern) Negative look ahead. - - [x] (*nla:pattern) Negative look ahead. - - [x] (*negative_lookahead:pattern) Negative look ahead. - - [ ] (?<=pattern) Positive look behind. - - [ ] (*plb:pattern) Positive look behind. - - [ ] (*positive_lookbehind:pattern) Positive look behind. - - [ ] (?