import Foundation
let pattern = #"(?=\b\d+[xX]\b)"#
let regex = try! NSRegularExpression(pattern: pattern, options: .anchorsMatchLines)
let testString = #"Some description art.nr: 4457 72 1x ACOUCH 90X200 NICE GRAY (3 colli) 1x matras 85x205x12 2x matras 80x190x11 Some specs 14x Premium otherproduct 90x200x23 HR34"#
let stringRange = NSRange(location: 0, length: testString.utf16.count)
let substitutionString = #"\n"#
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