Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Regex TagValidation — [GeneratedRegex] Source Generator

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
performance

Research direction

Open HistogramBase.cs and inspect the TagValidation declaration and its uses. Confirm the project targets .NET 8, then apply the stated GeneratedRegex pattern and run the existing test suite. Done means tag validation still works while using the source-generator form instead of the compiled Regex construction.

Written by the indexing model from the issue text.

Description

agent enhancement

File: HistogramBase.cs

private static readonly Regex TagValidation = new Regex("[, \\r\\n]", RegexOptions.Compiled);

On .NET 8 this should use the [GeneratedRegex] source generator, which produces fully AOT-safe, allocation-free regex matching with no startup compilation cost:

[GeneratedRegex("[, \\r\\n]")]
private static partial Regex TagValidation();

Minor on its own, but it's the right modern pattern and eliminates the compiled-regex warm-up allocation.

Dominant language
C#
Stars
185
Forks
31
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HdrHistogram/HdrHistogram.NET

All issues in HdrHistogram/HdrHistogram.NET

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.