ConfigToRegex 24.7.3.81

dotnet add package ConfigToRegex --version 24.7.3.81
                    
NuGet\Install-Package ConfigToRegex -Version 24.7.3.81
                    
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="ConfigToRegex" Version="24.7.3.81" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConfigToRegex" Version="24.7.3.81" />
                    
Directory.Packages.props
<PackageReference Include="ConfigToRegex" />
                    
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 ConfigToRegex --version 24.7.3.81
                    
#r "nuget: ConfigToRegex, 24.7.3.81"
                    
#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 ConfigToRegex@24.7.3.81
                    
#: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=ConfigToRegex&version=24.7.3.81
                    
Install as a Cake Addin
#tool nuget:?package=ConfigToRegex&version=24.7.3.81
                    
Install as a Cake Tool

ConfigToRegex

This dotnet library provides a tool for converting configuration documents (like JSON and YAML) to regular expressions. This idea stems from the belief that, while not everyone understands regular expressions, many can benefit from being able to define a desired pattern in a human-readable format.

Usage

For the best usage examples, please refer to the unit tests in the ConfigToRegex.Tests project. Here is a simple example of how to use the library:

This example uses a YAML configuration document to define a group regular expression pattern. When this example is run, the output will be a regular expression that matches the patterns defined in the configuration document.

YAML Configuration Document: testGroupPattern.yaml


Type: Group
Message: Testing Group Pattern
Patterns:
  - Type: Literal
    Message: testGroup0 message
    Value:
      Value: testGroup0
Properties:
  Name: testGroup0Name
  GroupType: NamedCapturing
  NamedGroupStyle: AngleBrackets

C# Code: Program.cs


using ConfigToRegex;
using System;
using System.IO;

namespace ConfigToRegex.Example
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = File.ReadAllText("testGroupPattern.yaml");
            var groupPattern = new GroupPattern(config);
            var regex = groupPattern.ToRegex()
        }
    }
}

Output: regex

(?<testGroup0Name>testGroup0)

Supported Configuration Document Types

  • JSON
  • YAML

Supported Pattern Types

  • Group
  • Literal
  • CharacterClass
  • Anchor
  • Quantifier

Contributing

If you would like to contribute to this project, please feel free to fork the repository and submit a pull request. If you have any questions or concerns, please feel free to reach out to me directly.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.
  • net8.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
24.7.3.81 208 7/3/2024
24.7.3.79 174 7/3/2024
24.7.2.74 174 7/2/2024