---
title: Lookahead
framework: regexbuilder
role: symbol
role_heading: Structure
path: regexbuilder/lookahead
---

# Lookahead

A regex component that allows a match to continue only if its contents match at the given location.

## Declaration

```swift
struct Lookahead<Output>
```

## Overview

Overview A lookahead is a zero-length assertion that its included regex matches at a particular position. Lookaheads do not advance the overall matching position in the input string — once a lookahead succeeds, matching continues in the regex from the same position.

## Topics

### Initializers

- [init(_:)](regexbuilder/lookahead/init(_:)-2yv8x.md)
- [init(_:)](regexbuilder/lookahead/init(_:)-4s5w2.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [RegexComponent](swift/regexcomponent.md)

## See Also

### Components

- [CharacterClass](regexbuilder/characterclass.md)
- [Anchor](regexbuilder/anchor.md)
- [NegativeLookahead](regexbuilder/negativelookahead.md)
- [ChoiceOf](regexbuilder/choiceof.md)
