This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension String { | |
| /// Use a regular expression pattern to find elements in a String. | |
| /// | |
| /// - Parameters: | |
| /// - pattern: Regular expression pattern. | |
| /// - options: Regular expressions options. | |
| /// - Returns: Array with elements matching the pattern passed in. | |
| /// - Throws: Regular expression errors. | |
| func matching(pattern: String, options: NSRegularExpression.Options) throws -> [String] { | |
| let regex = try NSRegularExpression(pattern: pattern, options: options) |