std.regex: document inline flags in the syntax table#11042
Merged
thewilsonator merged 1 commit intoJun 24, 2026
Conversation
Comment on lines
+208
to
+211
| $(REG_ROW (?imsx), Inline flags: enables one or more of the matching flags | ||
| i, m, s and x for the remainder of the pattern. A leading -, as in | ||
| (?-i), disables the flags that follow instead, so flags can be turned | ||
| on and off partway through a pattern. The g flag cannot be set inline. ) |
Contributor
There was a problem hiding this comment.
what do thee flags do? can you briefly define them inline here or link to their documentation.
Contributor
Author
There was a problem hiding this comment.
These flags are same as Regex flags below, I'll add note for this.
The inline flag syntax (?i), (?-i), (?ims) ... is implemented and works (parser.d handles s, x, i, m and - after (?), applying the flags to the rest of the pattern), but the syntax table had no entry for it, making it look unsupported. Add a (?flags) row describing the leading - toggle, linking the flag letters to the Regex flags table, and note that g is not available inline.
c557b46 to
e0e5231
Compare
thewilsonator
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
The inline flag syntax (?i), (?-i), (?ims) ... is implemented and works (parser.d handles s, x, i, m and - after (?), applying the flags to the rest of the pattern), but the syntax table had no entry for it, making it look unsupported. Add a row describing (?imsx) and the leading - toggle, and note that g is not available inline.
Pre-review checklist
[ ] If my PR fixes a bug or introduces a new feature, I have added thorough tests.[ ] If my changes are non-trivial and do not concern a reported issue, I have added a changelog entry.