{"id":21929951,"url":"https://github.com/a7mdfre7at/masterly.fluentregex","last_synced_at":"2025-04-19T18:54:13.308Z","repository":{"id":52241116,"uuid":"429637140","full_name":"a7mdfre7at/Masterly.FluentRegex","owner":"a7mdfre7at","description":"A creative way to Create regular expression patterns using readable  API.","archived":false,"fork":false,"pushed_at":"2022-03-14T11:53:29.000Z","size":74,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T12:01:29.134Z","etag":null,"topics":["fluent-api","regex","regular-expression","string-manipulation","string-matching"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a7mdfre7at.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-19T01:51:59.000Z","updated_at":"2022-09-22T23:13:56.000Z","dependencies_parsed_at":"2022-08-26T06:01:18.953Z","dependency_job_id":null,"html_url":"https://github.com/a7mdfre7at/Masterly.FluentRegex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7mdfre7at%2FMasterly.FluentRegex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7mdfre7at%2FMasterly.FluentRegex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7mdfre7at%2FMasterly.FluentRegex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7mdfre7at%2FMasterly.FluentRegex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a7mdfre7at","download_url":"https://codeload.github.com/a7mdfre7at/Masterly.FluentRegex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249770151,"owners_count":21323067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluent-api","regex","regular-expression","string-manipulation","string-matching"],"created_at":"2024-11-28T23:06:46.119Z","updated_at":"2025-04-19T18:54:13.280Z","avatar_url":"https://github.com/a7mdfre7at.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Masterly.FluentRegex\nA creative way to Create regular expression patterns using readable  API\n\n\u003cimg src=\"https://raw.githubusercontent.com/a7mdfre7at/Masterly.FluentRegex/master/repo_image.png\" width=\"200\" height=\"180\"\u003e\n\n[![Nuget](https://img.shields.io/nuget/v/Masterly.FluentRegex?style=flat-square)](https://www.nuget.org/packages/Masterly.FluentRegex) ![Nuget](https://img.shields.io/nuget/dt/Masterly.FluentRegex?label=nuget%20downloads\u0026style=flat-square) ![GitHub last commit](https://img.shields.io/github/last-commit/a7mdfre7at/Masterly.FluentRegex?style=flat-square) ![GitHub](https://img.shields.io/github/license/a7mdfre7at/Masterly.FluentRegex?style=flat-square) [![Build](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/build.yml/badge.svg)](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/build.yml) [![CodeQL Analysis](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/codeql-analysis.yml) [![Publish to NuGet](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/publish.yml/badge.svg)](https://github.com/a7mdfre7at/Masterly.FluentRegex/actions/workflows/publish.yml)\n\n## Give a Star! :star:\n\nIf you like or are using this project please give it a star. Thanks!\n\n## Introduction\n\n\u003e Some people, when confronted with a problem, think \"I know, I'll use regular expressions.\" Now they have two problems. *- Jamie Zawinski*\n\nDoes that make this a 3rd problem?\n\nRegular expressions can be extremely useful in the right circumstances, but they can also be terriblly complicated to understand. Consider this regular expression for parsing email addresses based on the RFC 5322 standard:\n\n```c#\n(?:[a-z0-9!#$%\u0026'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%\u0026'*+/=?^_`{|}~-]+)*\n  |  \"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]\n      |  \\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")\n@ (?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\n  |  \\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}\n       (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:\n          (?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]\n          |  \\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\n     \\])\n```\n\nWhat human can possibly read and understand that? \n\nIn an effort to create a more readable method of writing regular expressions in .NET, I've created **FluentRegex**.\n\n## Examples\n\nLet's use a simpler email regular expression to demonstrate some of the library's capabilities.\n\nNormally, we'd write the regular expression something like this:\n```c#\nstring regex = @\"^[a-zA-Z\\d\\.-_]+@[a-zA-Z\\d\\.-]+\\.[a-zA-Z]{2,4}$\";\n```\n\nWith FluentRegex, we can express it like this:\n```c#\nPattern p = Pattern.With\n                   .StartOfLine\n                   .Set(Pattern.With.Letter.Digit.Literal(\".-_\")).Repeat.OneOrMore\n                   .Literal(\"@\")\n                   .Set(Pattern.With.Letter.Digit.Literal(\".-\")).Repeat.OneOrMore\n                   .Literal(\".\")\n                   .Set(Pattern.With.Letter).Repeat.Times(2, 4)\n                   .EndOfLine;\n```\n\nFor more samples, please see tests in unit test project [Here](https://github.com/a7mdfre7at/Masterly.FluentRegex/tree/master/test/Masterly.FluentRegex.UnitTests \"Here\")                \n\n\n## License\n\nMIT\n\n**Free Software, Hell Yeah!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7mdfre7at%2Fmasterly.fluentregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7mdfre7at%2Fmasterly.fluentregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7mdfre7at%2Fmasterly.fluentregex/lists"}