import Foundation
let pattern = #"<\/?[bi]>"#
let regex = try! NSRegularExpression(pattern: pattern)
let testString = #"""
<p>
<b>Property Location
</b>
<br />With a stay at Park Plaza Westminster Bridge London, you''ll be centrally located in London, steps from London Aquarium and Florence Nightingale Museum. This 4-star hotel is close to Trafalgar Square and Buckingham Palace.
</p>
<p>
<b>Rooms
</b>
<br />Make yourself at home in one of the 1019 air-conditioned rooms featuring refrigerators and plasma televisions. Your memory foam bed comes with down blankets and Egyptian cotton sheets. Complimentary wireless Internet access keeps you connected, and cable programming is available for your entertainment. Private bathrooms with separate bathtubs and showers feature handheld showerheads and complimentary toiletries.
</p>
<p>
<b>Rec, Spa, Premium Amenities
</b>
<br />Relax at the full-service spa, where you can enjoy massages, body treatments, and facials. You can take advantage of recreational amenities such as an indoor pool, a sauna, and a steam room. This hotel also features complimentary wireless Internet access, concierge services, and wedding services.
</p>
<p>
<b>Dining
</b>
<br />Enjoy a bite to eat at a coffee shop/café, or stay in and take advantage of the hotel''s 24-hour room service. Relax with a refreshing drink at one of the 2 bars/lounges.
</p>
<p>
<b>Business, Other Amenities
</b>
<br />Featured amenities include high-speed (wired) Internet access (surcharge), a business center, and an Internet point. Event facilities at this hotel consist of a ballroom, banquet facilities, and exhibit space. Parking (subject to charges) is conveniently located nearby.
</p>
"""#
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