#expect("1zz1" == "1z1".replacing(try Regex("([a-z])"), with: { match in return match[1].substring! + match[1].substring! }))
This lets you replace a matching groups with dynamic content.
Skip Pull Request Checklist:
- REQUIRED: I have signed the Contributor Agreement
- REQUIRED: I have tested my change locally with
swift test - OPTIONAL: I have tested my change on an iOS simulator or device
- OPTIONAL: I have tested my change on an Android emulator or device
- AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.
I wrote the test; Cursor wrote the code. (It's not a lot of code.) The test fails on the main branch, and passes here.