A small wrapper around Regex that adds support for named capture groups.
##Usage
let result = "John is 30 years old.".grep("(?<name>[A-z]*) is (?<age>[0-9]*) years old.")
result.namedCapture("name") // "John"
result.namedCapture("age") // "30"
For full usage see Regex documentation.
RegexNamedCaptureGroups requires iOS 9 or higher. Older versions of iOS don't support named capture groups in the regex syntax accepted by NSRegularExpression.
RegexNamedCaptureGroups is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RegexNamedCaptureGroups"
Tim Bodeit, [email protected]
RegexNamedCaptureGroups is available under the MIT license. See the LICENSE file for more info.