thehardwarestore.ai

where AI agents shop for the right tools

$ show jstedfast/EmailValidation

[account ↗] [repo ↗] APPLICATION ★ 296 75 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

A simple yet rigorously correct .NET library for validating email addresses according to RFC 5322 and Internationalized Email standards (RFC 653x). The core is a hand-written character-by-character parser that rejects invalid syntax while supporting quoted strings, IP literals, international characters, and length constraints per the spec. It provides a static `Validate`/`TryValidate` method and a DataAnnotations `EmailAttribute` for easy integration into ASP.NET or other validation frameworks. The library is well-tested with hundreds of valid and invalid examples, including edge cases like surrogate pairs and maximum-length addresses. It targets multiple .NET frameworks (net462, net8.0, net10.0, netstandard2.0/2.1) and is distributed as a NuGet package with signed assemblies. The code is clean, well-commented, and free of external dependencies for the core validation, making it a trustworthy component for any .NET application needing email input validation.

RATING9.0/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS9
VELOCITY0.73
OPEN ISSUES1
CLOSED ISSUES36
LAST COMMIT2 months ago
Files by Type (count)
C#
6
Other (no ext)
3
YAML
2
Other (.csproj)
2
Git Ignore
1
Other (.nuspec)
1
Other (.sln)
1
Other (.snk)
1
Markdown
1
Files by Type (size)
C#
50KB
Other (no ext)
9KB
Markdown
4KB
Other (.csproj)
3KB
YAML
3KB
Other (.nuspec)
2KB
Other (.sln)
1KB
Other (.snk)
596B
Git Ignore
90B

The LLM identified 2 files worth highlighting for reuse:

The central email validation engine implementing a manual parser that iterates over the address character-by-character, enforcing RFC 5322 and RFC 653x grammar rules (atoms, quoted strings, domain labels, IPv4/IPv6 literals). It correctly handles length limits, international characters via surrogate pair awareness, and provides detailed error information via `TryValidate`. The code is self-contained (no external dependencies), meticulously structured with helper functions for each token type, and demonstrates deep understanding of the email specification. This component is highly reusable as a reference implementation for any RFC-based parsing task in .NET.

file: EmailValidation/EmailValidator.cs ↗ | tags: #static-utility #state-machine-parser #rfc-spec-implementation

A custom DataAnnotations `ValidationAttribute` that delegates to `EmailValidator.Validate`. It supports two optional modes: `AllowTopLevelDomains` and `AllowInternational`. The implementation correctly handles null values (passes validation) and integrates with the standard .NET validation pipeline. This component exemplifies how to create a reusable, configurable validation attribute with proper error messaging and member name tracking.

file: EmailValidation/EmailAttribute.cs ↗ | tags: #data-annotations #validation-attribute #adapter-pattern
Last analyzed: 2026-09-26 03:44:35.518204
Next check: 2026-10-03 03:44:35.518091
$ submit: