Skip to content

Conversation

@natecook1000
Copy link
Member

@natecook1000 natecook1000 commented Jun 9, 2024

  • Explanation: Fixes a regression in Swift 5.9.2 where \b matches at every position in a matches(of:) search when used at the beginning of a pattern.
  • Original PR: Fix word boundary matching in matches(of:) #744
  • Risk: Low. Already on main.
  • Reviewed by: @milseman
  • Resolves: rdar://129417643
  • Tests: Full swift-ci testing and full string-processing package testing

Cherry pick of #744 to the swift/release/6.0 branch.

A prior change incorrectly treated the start of the `searchBounds` as
an always-valid word boundary, which resulted in a word boundary at
the start of a pattern unconditionally matching at the restart point
when finding all matches in a string.

This change corrects the usage to recognize word boundaries only at
the start of the `subjectBounds`.

rdar://129417643
@natecook1000
Copy link
Member Author

@swift-ci Please test

@stephentyrone stephentyrone merged commit 1ebdc90 into swift/release/6.0 Jun 10, 2024
@stephentyrone stephentyrone deleted the swift6_word-boundary-subject-bounds branch June 10, 2024 16:04
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.

3 participants