---
title: "repetitionBehavior(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/regex/repetitionbehavior(_:)"
---

# repetitionBehavior(_:)

Returns a regular expression where quantifiers use the specified behavior by default.

## Declaration

```swift
func repetitionBehavior(_ behavior: RegexRepetitionBehavior) -> Regex<Regex<Output>.RegexOutput>
```

## Parameters

- `behavior`: The default behavior to use for quantifiers.

## Discussion

Discussion This setting does not affect calls to quantifier methods, such as OneOrMore, that include an explicit behavior parameter. Passing .eager or .reluctant to this method corresponds to applying the (?-U) or (?U) option in regex syntax, respectively.
