Recently I needed to extract a data from Apple’s HealthKit. They provide various queries in HealthKit framework. But it didns’t meet my intention.
So I started to use NSString substring function to extract the data. But, it wasn’t good to match the data that I want.
Finally I got the exact result by using NSRegularExpression and during the process this tutorial was really helpful.
And I think that this is the latest NSRegularExpression tutorial on the web.
So if you want to learn how to use a regular expression in Swift, I recommend the link above.