---
title: "init(count:_:)"
framework: regexbuilder
role: symbol
role_heading: Initializer
path: "regexbuilder/repeat/init(count:_:)-1g72m"
---

# init(count:_:)

Creates a regex component that matches the given component repeated the specified number of times.

## Declaration

```swift
init<W, C1>(count: Int, @RegexComponentBuilder _ componentBuilder: () -> some RegexComponent) where Output == (Substring, C1?)
```

## Parameters

- `count`: The number of times to repeat component. count must be greater than or equal to zero.
- `componentBuilder`: A builder closure that creates the regex component to repeat.
