Skip to content

refactor(scanner): migrate to Swift Regex and remove NSString bridges#288

Merged
p-linnane merged 1 commit into
mainfrom
refactor/swift-regex
Mar 29, 2026
Merged

refactor(scanner): migrate to Swift Regex and remove NSString bridges#288
p-linnane merged 1 commit into
mainfrom
refactor/swift-regex

Conversation

@p-linnane
Copy link
Copy Markdown
Member

Summary

  • Replace NSRegularExpression with Swift Regex literals in KernelParser (3 patterns) and IPSWExtractor (1 pattern)
  • Replace NSRegularExpression with Regex(pattern) for runtime patterns in SDKMetadataParser and BinaryStringScanner
  • Fall back to NSRegularExpression in BinaryStringScanner for patterns using lookbehind (unsupported by Swift Regex)
  • Replace 7 (string as NSString).lastPathComponent casts with URL(fileURLWithPath:).lastPathComponent in IPSWExtractor

Replace `NSRegularExpression` with Swift `Regex` literals and
`Regex(pattern)` across the scanner pipeline. Fall back to
`NSRegularExpression` in `BinaryStringScanner` for patterns using
lookbehind (unsupported by Swift Regex). Replace `(string as
NSString).lastPathComponent` casts with `URL(fileURLWithPath:)`
in `IPSWExtractor`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Patrick Linnane <patrick@linnane.io>
@p-linnane p-linnane merged commit fdca638 into main Mar 29, 2026
6 checks passed
@p-linnane p-linnane deleted the refactor/swift-regex branch March 29, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant