# RegexPattern.Options.update(with:)

- **Module:** RegexPattern.Options
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Page:** https://libtmux.org/reference/swift/regexpattern-options-update(with-)/

```
RegexPattern.Options.update(with:)(with: Self.Element) -> Self.Element?
```

Inserts the given element into the set.

If `newMember` is not contained in the set but subsumes current members
of the set, the subsumed members are returned.

    var options: ShippingOptions = [.secondDay, .priority]
    let replaced = options.update(with: .express)
    print(replaced == .secondDay)
    // Prints "true"

- Returns: The intersection of `[newMember]` and the set if the
  intersection was nonempty; otherwise, `nil`.
