Lookahead

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

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
struct Lookahead<Output>

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.