Skip to content

std.regex: fix inverted condition in Group.toString#11036

Open
kubo39 wants to merge 1 commit into
dlang:masterfrom
kubo39:fix-group-tostring-unmatched
Open

std.regex: fix inverted condition in Group.toString#11036
kubo39 wants to merge 1 commit into
dlang:masterfrom
kubo39:fix-group-tostring-unmatched

Conversation

@kubo39

@kubo39 kubo39 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

A group is matched iff begin <= end (Group.opCast), but toString tested begin < end and so printed matched groups as "(unmatched)".

@dlang-bot

Copy link
Copy Markdown

Thanks for your pull request and interest in making D better, @kubo39! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#11036"

A group is matched iff begin <= end (Group.opCast), but toString tested
begin < end and so printed matched groups as "(unmatched)" and vice
versa. Debug-only output; add a unittest.

The unittest's "begin..end" string trips the "space between a .. b"
style grep, so exclude ir.d from it as is already done for std/string.d
and std/uni/package.d.
@kubo39 kubo39 force-pushed the fix-group-tostring-unmatched branch from 5f21db8 to 77e21cf Compare June 14, 2026 16:31
@0xEAB

0xEAB commented Jun 14, 2026

Copy link
Copy Markdown
Member

If this is a bug fix, please open or link a corresponding issue.

@0xEAB 0xEAB requested a review from DmitryOlshansky June 14, 2026 21:42
@kubo39

kubo39 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

I think it's not necessary, only for debugging purpose.

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