Rejigs 1.2.0
dotnet add package Rejigs --version 1.2.0
NuGet\Install-Package Rejigs -Version 1.2.0
<PackageReference Include="Rejigs" Version="1.2.0" />
<PackageVersion Include="Rejigs" Version="1.2.0" />
<PackageReference Include="Rejigs" />
paket add Rejigs --version 1.2.0
#r "nuget: Rejigs, 1.2.0"
#:package Rejigs@1.2.0
#addin nuget:?package=Rejigs&version=1.2.0
#tool nuget:?package=Rejigs&version=1.2.0
Rejigs
🧩 A fluent, intuitive builder for regular expressions in C#
Rejigs makes creating complex regular expressions simple and readable by providing a fluent API that builds patterns step by step. No more cryptic regex syntax - write patterns that are easy to understand and maintain!
🚀 Getting Started
Installation
Install Rejigs via NuGet Package Manager:
dotnet add package Rejigs
Or via Package Manager Console:
Install-Package Rejigs
Basic Usage
using Rejigs;
// Simple text matching
var regex = Rejigs.Create()
.AtStart()
.Text("hello")
.AtEnd()
.Build();
Console.WriteLine(regex.IsMatch("hello")); // True
Console.WriteLine(regex.IsMatch("hello world")); // False
📖 Real-World Example
Email Validation
var emailRegex = Rejigs.Create()
.AtStart()
.OneOrMore(r => r.AnyLetterOrDigit().Or().AnyOf(".-_")) // Local part
.Text("@")
.OneOrMore(r => r.AnyLetterOrDigit().Or().AnyOf(".-")) // Domain
.Text(".")
.AnyInRange('a', 'z') // Top-level domain (2-6 letters)
.Between(2, 6)
.AtEnd()
.IgnoreCase() // Case-insensitive matching
.Build();
Console.WriteLine(emailRegex.IsMatch("user@example.com")); // True
Console.WriteLine(emailRegex.IsMatch("invalid-email")); // False
🎯 Tips and Best Practices
- Use descriptive variable names:
var emailRegex = ...
instead ofvar regex = ...
- Break complex patterns into smaller parts: Use variables to store intermediate builders
- Add comments: Explain what each part of your regex does
- Test thoroughly: Use unit tests to verify your patterns work correctly
- Use
AtStart()
andAtEnd()
: For exact matches, always anchor your patterns
📚 Documentation
For detailed documentation, examples, and API reference, visit the Rejigs Documentation.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to raise an issue or a PR.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.