Regex
public struct Regex: Pattern
A pattern type that uses the NSRegularExpression engine
-
initializer for common use-case of specifying only the case-sensitivity option
Declaration
Swift
init?(_ pattern: String, matchCase: Bool)
-
initializer for full NSRegularExpression option set
Declaration
Swift
init?(_ pattern: String, options: NSRegularExpression.Options = [])
-
Declaration
Swift
var supportsSubMatches: Bool
-
Declaration
Swift
func locate(in target: String) -> StringRange?
-
Declaration
Swift
func iterate(over target: String, configuredBy config: SearchConfig, using block: (RangeFragment) -> Bool) -> MatchCount
-
Declaration
Swift
func replaceMatches(in target: String, to template: String) -> String
-
Declaration
Swift
func escape(template: String) -> String
-
Declaration
Swift
var supportsReplaceTemplates: Bool
-
Escapes the special characters in the given string
- pattern: the input string escape data from
Declaration
Swift
public static func escape(pattern src: String) -> String