PySwiftyRegex 是 Swift 的像 Python 的 re 模块一样简洁高效的正则表达式封装,面向 iOS/OSX,支持 Cocoapods。 示例代码: import PySwiftyRegexif let m = re.search("[Tt]his is (.*?)easy", "I think this is really easy!!!") { m.group() // "this is really easy" m.group(1) // "real
PySwiftyRegex
在Swift中以Pythonic方式轻松处理Regex。
这很容易
import PySwiftyRegex
if let m = re. search ( " [Tt]his is (.*?)easy " , " I think this is really easy!!! " ) {
m. group () // "this is really easy"
m. group ( 1 ) // "really "
}
请参阅。
要求
iOS 7.0以上/