Skip to content

Conversation

@naitoh
Copy link
Contributor

@naitoh naitoh commented Feb 22, 2025

Fix GH-139

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

Do we have scanner.scan("not-matched") case?

@naitoh naitoh force-pushed the fix_IndexError_for_unknown_capture_group branch 2 times, most recently from 98ca322 to 48a7359 Compare February 23, 2025 03:30
@naitoh
Copy link
Contributor Author

naitoh commented Feb 23, 2025

Do we have scanner.scan("not-matched") case?

Added.

In the not-matched case, nil return without exception.
But since the results of Regexp pattern and String pattern are the same, so I think no problem.

@naitoh naitoh requested a review from kou February 23, 2025 04:00
@naitoh naitoh force-pushed the fix_IndexError_for_unknown_capture_group branch from 48a7359 to e515324 Compare February 23, 2025 05:48
@naitoh naitoh requested a review from kou February 23, 2025 06:01
@kou kou merged commit bc8a0d2 into ruby:master Feb 23, 2025
40 checks passed
@kou
Copy link
Member

kou commented Feb 23, 2025

Thanks.

@naitoh naitoh deleted the fix_IndexError_for_unknown_capture_group branch February 23, 2025 07:57
hsbt pushed a commit to hsbt/ruby that referenced this pull request Feb 25, 2025
hsbt pushed a commit to ruby/ruby that referenced this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistency of IndexError vs nil for unknown capture group

2 participants