BSONRegularExpression
public struct BSONRegularExpression : Equatable, Hashable
A struct to represent a BSON regular expression.
-
The pattern for this regular expression.
Declaration
Swift
public let pattern: String
-
A string containing options for this regular expression.
Declaration
Swift
public let options: String
-
Initializes a new
BSONRegularExpression
with the provided pattern and options.Declaration
Swift
public init(pattern: String, options: String)
-
Initializes a new
BSONRegularExpression
with the pattern and options of the providedNSRegularExpression
.Declaration
Swift
public init(from regex: NSRegularExpression)
-
Converts this
BSONRegularExpression
to anNSRegularExpression
. Note:NSRegularExpression
does not support thel
locale dependence option, so it will be omitted if it was set on this instance.Declaration
Swift
public func toNSRegularExpression() throws -> NSRegularExpression