Skip to content

Fix content parameter docs for regex replacing APIs - #916

Open
sarthakkaushik927 wants to merge 1 commit into
swiftlang:mainfrom
sarthakkaushik927:docs/replacing-content-param
Open

sarthakkaushik927 wants to merge 1 commit into
swiftlang:mainfrom
sarthakkaushik927:docs/replacing-content-param

Conversation

@sarthakkaushik927

@sarthakkaushik927 sarthakkaushik927 commented Oct 30, 2026 •

Copy link
Copy Markdown

The RegexBuilder replacing(...) and replace(...) overloads that take a regex-builder closure described their content parameter as:

A closure that returns the collection to search for and replace.

The closure returns a regex, not a collection. This changes the six occurrences in Sources/RegexBuilder/Algorithms.swift to "A closure that returns the regex to search for and replace", matching the wording the other RegexBuilder algorithms in the same file already use.

Documentation only; no code changes.

Resolves swiftlang/swift#74008

The RegexBuilder replacing(...) and replace(...) overloads described
their `content` parameter as "A closure that returns the collection to
search for and replace", but the closure builds a regex. Say "regex"
instead.

Resolves swiftlang/swift#74008

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad documentation of 'content' parameter in replacing(with:content:) Regex APIs

1 participant