regexp: support capture groups in Regexp#===#6884
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the regexp_case_match function in regexp.c to use exec_match instead of mrb_re_exec, ensuring that global match variables (like $1) are correctly populated during case equality (===) operations. A corresponding test case has been added to verify this behavior. Feedback on the changes points out a minor syntax issue with a redundant double semicolon at the end of a return statement in regexp.c.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| int ncap = mrb_re_exec(mrb, pat, RSTRING_PTR(str), RSTRING_LEN(str), 0, NULL, 0); | ||
| return mrb_bool_value(ncap > 0); | ||
| md = exec_match(mrb, self, str, 0); | ||
| return mrb_bool_value(!mrb_nil_p(md));; |
Please close if there is a better way to do this.
Thanks.
Fixes #6883