<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSRegularExpression/MatchingFlags",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSMatchingFlags"
  },
  "title" : "NSRegularExpression.MatchingFlags"
}
-->

# NSRegularExpression.MatchingFlags

Set by the Block as the matching progresses, completes, or fails. Used by the method [`enumerateMatches(in:options:range:using:)`](/documentation/Foundation/NSRegularExpression/enumerateMatches(in:options:range:using:)).

```
struct MatchingFlags
```

## Topics

### Constants

[`NSMatchingProgress`](/documentation/Foundation/NSRegularExpression/MatchingFlags/progress)

Set when the Block is called to report progress during a long-running match operation.

[`NSMatchingCompleted`](/documentation/Foundation/NSRegularExpression/MatchingFlags/completed)

Set when the Block is called after matching has completed.

[`NSMatchingHitEnd`](/documentation/Foundation/NSRegularExpression/MatchingFlags/hitEnd)

Set when the current match operation reached the end of the search range.

[`NSMatchingRequiredEnd`](/documentation/Foundation/NSRegularExpression/MatchingFlags/requiredEnd)

Set when the current match depended on the location of the end of the search range.

[`NSMatchingInternalError`](/documentation/Foundation/NSRegularExpression/MatchingFlags/internalError)

Set when matching failed due to an internal error.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

---

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)