SafeRegex

public struct SafeRegex : @unchecked Sendable

A thread-safe wrapper around NSRegularExpression that makes regex instances compatible with Sendable requirements.

  • The compiled regular expression, or nil if the pattern could not be compiled (e.g. invalid syntax).

    Declaration

    Swift

    public let regex: NSRegularExpression?