Fabian2000 / regexhelper

RegExHelper is designed to help people with less knowledge about regex, so that they are still able to use regex by themself

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RegexHelper

RegexHelper is a C# library that helps developers create regular expressions (RegEx) with ease. It provides a clear and intuitive syntax for building RegEx patterns, along with preconfigured RegEx codes for commonly used scenarios.

Features

  • Fluent RegEx Builder: Use the RegexBuilder class to create RegEx patterns in a simple and readable manner.
  • Preconfigured RegEx Codes: The RegExPrepared class contains a collection of predefined RegEx codes for typical use cases.
  • Easy Installation: The project is based on .NET7 (C# 11) and can be installed via NuGet.
  • Cross-Platform: The library is platform-independent and can be used in .NET applications on various operating systems.

Usage

Use the RegexBuilder class to create RegEx patterns. Here's a simple example:

var regex = new RegExBuilder()
    .Start()
    .Text("Hello")
    .WhiteSpace()
    .OneOrMoreOfLastExpression()
    .Text("World")
    .End()
    .ToRegex();

string input = "Hello     World";
bool isMatch = regex.IsMatch(input);

Console.WriteLine($"Input: {input}");
Console.WriteLine($"Is Match: {isMatch}");
Console.ReadKey(true);

For more examples and detailed information, please refer to the documentation.

License

This project is licensed under the MIT License. For more information, see the license file.

About

RegExHelper is designed to help people with less knowledge about regex, so that they are still able to use regex by themself

License:MIT License


Languages

Language:C# 100.0%