swift check if regex is in string

Swift
if string.range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil ...
Source

Also in Swift: