XcodeGen/Sources/ProjectSpec/NSRegularExpressionExtensions.swift
2020-06-17 18:12:34 +10:00

11 lines
260 B
Swift

import Foundation
public extension NSRegularExpression {
func isMatch(to string: String) -> Bool {
let range = NSRange(location: 0, length: string.utf16.count)
return self.firstMatch(in: string, options: [], range: range) != nil
}
}