import Foundation
let pattern = #"[^\w\s|https?:\/\/.\-*\s]|\W*\b\d+(?:\.\d+)?\b"#
let regex = try! NSRegularExpression(pattern: pattern)
let testString = #"Good Day,I would like to $1000 (for example remove these parenthesis) $test $ asdf [and remove these brackets] inquire the price of the 3D product name here. Currently we have the other product name here which I believe has an accuracy of about 0.0005 199 200. http://www.example.com this is a test"#
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