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) // "really " }
环境:
iOS 7.0+ / Mac OS X 10.9+
Xcode 7.0
README: https://github.com/cezheng/PySwiftyRegex/blob/master/README-zh.md