import Foundation
let pattern = #"\\0[\d:]*\\+"#
let regex = try! NSRegularExpression(pattern: pattern, options: .anchorsMatchLines)
let testString = #"{\rtf1\ansi\ansicpg1252\cocoartf2511\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}{\colortbl;\red255\green255\blue255;}{*\expandedcolortbl;;}\margl1440\margr1440\vieww10800\viewh8400\viewkind0\deftab560\pard\pardeftab560\ri0\partightenfactor0\f0\fs24 \cf0 Say that this person is to blame\0:20:48\and the others that were involved.\0:20:51\And since we're not to blame 155 in fact,\0:20:54\innocent punishment is a way to\0:20:56\express this distribution of lame\0:20:59\in certain situation as such.\0:21:01\I punishment has,"#
let stringRange = NSRange(location: 0, length: testString.utf16.count)
let substitutionString = #" "#
let result = regex.stringByReplacingMatches(in: testString, range: stringRange, withTemplate: substitutionString)
print(result)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Swift 5.2, please visit: https://developer.apple.com/documentation/foundation/nsregularexpression