Skip to content

std.regex: document inline flags in the syntax table#11042

Merged
thewilsonator merged 1 commit into
dlang:masterfrom
kubo39:document-inline-flags-syntax-table
Jun 24, 2026
Merged

std.regex: document inline flags in the syntax table#11042
thewilsonator merged 1 commit into
dlang:masterfrom
kubo39:document-inline-flags-syntax-table

Conversation

@kubo39

@kubo39 kubo39 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

  • I have performed a self-review of my code.
  • [ ] 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.

@kubo39 kubo39 requested a review from DmitryOlshansky as a code owner June 23, 2026 22:49
Comment thread std/regex/package.d Outdated
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. )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do thee flags do? can you briefly define them inline here or link to their documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These flags are same as Regex flags below, I'll add note for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.
@kubo39 kubo39 force-pushed the document-inline-flags-syntax-table branch from c557b46 to e0e5231 Compare June 23, 2026 23:34
@thewilsonator thewilsonator merged commit c9b044c into dlang:master Jun 24, 2026
10 checks passed
@kubo39 kubo39 deleted the document-inline-flags-syntax-table branch June 24, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants