String

struct String
  • Searches the receiving String with the regex given in pattern, returning the match results.

    Declaration

    Swift

    public func grep (pattern:String) -> Regex.MatchResult
  • Searches the receiving string with the regex given in pattern, replaces the match(es) with replacement, and returns the resulting string.

    Declaration

    Swift

    public func replaceRegex(pattern:String, with replacement:String) -> String