Removing dead code part 2 (#2235)

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-12-15 20:16:16 +01:00
committed by GitHub
parent 2f88d39789
commit 123164f398
91 changed files with 64 additions and 694 deletions
@@ -18,23 +18,11 @@ import Foundation
/// NSRegularExpressions work internally on NSStrings, we need to be careful how we build the ranges for extended grapheme clusters https://stackoverflow.com/a/27880748/730924
extension NSRegularExpression {
func enumerateMatches(in string: String, options: NSRegularExpression.MatchingOptions = [], using block: (NSTextCheckingResult?, NSRegularExpression.MatchingFlags, UnsafeMutablePointer<ObjCBool>) -> Void) {
enumerateMatches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length), using: block)
}
func matches(in string: String, options: NSRegularExpression.MatchingOptions = []) -> [NSTextCheckingResult] {
matches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length))
}
func numberOfMatches(in string: String, options: NSRegularExpression.MatchingOptions = []) -> Int {
numberOfMatches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length))
}
func firstMatch(in string: String, options: NSRegularExpression.MatchingOptions = []) -> NSTextCheckingResult? {
firstMatch(in: string, options: options, range: .init(location: 0, length: (string as NSString).length))
}
func rangeOfFirstMatch(in string: String, options: NSRegularExpression.MatchingOptions = []) -> NSRange {
rangeOfFirstMatch(in: string, options: options, range: .init(location: 0, length: (string as NSString).length))
}
}