<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSRegularExpression/options-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSRegularExpression(py)options"
  },
  "title" : "options"
}
-->

# options

Returns the options used when the regular expression option was created.

```
var options: NSRegularExpression.Options { get }
```

## Discussion

The options property specifies aspects of the regular expression matching that are always used when matching the regular expression. For example, if the expression is case sensitive, allows comments, ignores metacharacters, etc. See [`NSRegularExpression.Options`](/documentation/Foundation/NSRegularExpression/Options-swift.struct) for a complete discussion of the possible constants and their meanings.

## See Also

[`regularExpressionWithPattern:options:error:`](/documentation/Foundation/NSRegularExpression/regularExpressionWithPattern:options:error:)

Creates an NSRegularExpression instance with the specified regular expression pattern and options.

[`init(pattern:options:)`](/documentation/Foundation/NSRegularExpression/init(pattern:options:))

Returns an initialized NSRegularExpression instance with the specified regular expression pattern and options.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)