Rejigs 1.2.0

dotnet add package Rejigs --version 1.2.0
                    
NuGet\Install-Package Rejigs -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rejigs" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rejigs" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Rejigs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rejigs --version 1.2.0
                    
#r "nuget: Rejigs, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rejigs@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rejigs&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Rejigs&version=1.2.0
                    
Install as a Cake Tool

NuGet NuGet Build Status

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

  1. Use descriptive variable names: var emailRegex = ... instead of var regex = ...
  2. Break complex patterns into smaller parts: Use variables to store intermediate builders
  3. Add comments: Explain what each part of your regex does
  4. Test thoroughly: Use unit tests to verify your patterns work correctly
  5. Use AtStart() and AtEnd(): 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.2.0 48 8/15/2025
1.1.0 73 7/18/2025
1.0.7 113 7/13/2025
1.0.6 87 7/11/2025
1.0.5 139 7/8/2025
1.0.4 139 7/8/2025
1.0.3 137 7/7/2025
1.0.2 92 7/4/2025
1.0.1 91 6/27/2025
1.0.0 92 6/27/2025
0.0.0-alpha.0 72 6/27/2025