Skip to content

timbodeit/RegexNamedCaptureGroups

Repository files navigation

RegexNamedCaptureGroups

CI Status Version License Platform

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.

Requirements

RegexNamedCaptureGroups requires iOS 9 or higher. Older versions of iOS don't support named capture groups in the regex syntax accepted by NSRegularExpression.

Installation

RegexNamedCaptureGroups is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RegexNamedCaptureGroups"

Author

Tim Bodeit, [email protected]

License

RegexNamedCaptureGroups is available under the MIT license. See the LICENSE file for more info.

About

Regex with named capture groups for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published