Skip to content

Backport missing Regex constructor remarks and examples - #131168

Closed
gewarren with Copilot wants to merge 2 commits into
mainfrom
copilot/backport-remarks-examples-system-text-regular-expr
Closed

Backport missing Regex constructor remarks and examples#131168
gewarren with Copilot wants to merge 2 commits into
mainfrom
copilot/backport-remarks-examples-system-text-regular-expr

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

System.Text.RegularExpressions constructor docs were missing remarks and examples that had already been backported elsewhere in the API docs flow. This updates the runtime source docs so the constructor guidance and examples live with the source of truth.

  • Documentation backport

    • Added missing remarks content to the three public Regex constructors in /home/runner/work/runtime/runtime/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs.
    • Restored constructor-specific guidance around pattern behavior, case sensitivity, and match timeout usage.
  • Example coverage

    • Added snippet-backed examples in /home/runner/work/runtime/runtime/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Examples.cs for:
      • new Regex(string)
      • new Regex(string, RegexOptions)
      • new Regex(string, RegexOptions, TimeSpan)
    • Wired the constructor docs to those validated snippets using the existing doc example pattern.
  • Example stability

    • Kept the timeout example behaviorally equivalent while reducing the adversarial input length so the example remains suitable for slower test environments.
string pattern = @"\b[at]\w+\b";
string input = "The archive was trimmed and tagged.";
MatchCollection matches = new Regex(pattern, RegexOptions.IgnoreCase).Matches(input);

foreach (Match match in matches)
    Console.WriteLine(match.Value);

Copilot AI review requested due to automatic review settings July 21, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Backport remarks and examples for System.Text.RegularExpressions Backport missing Regex constructor remarks and examples Jul 21, 2026
Copilot AI requested a review from gewarren July 21, 2026 21:12
@gewarren gewarren closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backport remarks/examples for System.Text.RegularExpressions

3 participants