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 = [])
  • 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