swifter-tips / Public-Issues

Public issues for Swifter-tips book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

正则表达式函数错误

porridgec opened this issue · comments

正则表达式一节,书中的代码是:

let matches = regex.matchesInString(input,
                    options: [],
                    range: NSMakeRange(0, input.utf16.count))

但是Swift 3中应为

let matches = regex.matches(in: input,
                    options: [],
                    range: NSMakeRange(0, input.utf16.count))

感谢指出,尽快修正!

哇喵神回复好快