{"id":19244322,"url":"https://github.com/nanoframework/system.text.regularexpressions","last_synced_at":"2025-10-15T23:42:06.265Z","repository":{"id":38180463,"uuid":"347382570","full_name":"nanoframework/System.Text.RegularExpressions","owner":"nanoframework","description":":package: .NET nanoFramework System.Text.RegularExpressions Class Library","archived":false,"fork":false,"pushed_at":"2025-05-02T12:55:10.000Z","size":304,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-13T06:25:31.560Z","etag":null,"topics":["csharp","dotnet","hacktoberfest","library","nanoframework","parser","regex"],"latest_commit_sha":null,"homepage":"https://www.nanoframework.net","language":"C#","has_issues":false,"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/nanoframework.png","metadata":{"funding":{"open_collective":"nanoframework","github":"nanoframework"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-13T13:47:37.000Z","updated_at":"2025-05-02T12:55:12.000Z","dependencies_parsed_at":"2023-02-09T19:31:11.348Z","dependency_job_id":"e639026d-0368-482c-a498-bd08e2f2d035","html_url":"https://github.com/nanoframework/System.Text.RegularExpressions","commit_stats":{"total_commits":163,"total_committers":6,"mean_commits":"27.166666666666668","dds":"0.44171779141104295","last_synced_commit":"2dbd1d3440f942fb4ce8870739d3dde2fb82f9b2"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/nanoframework/System.Text.RegularExpressions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.Text.RegularExpressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.Text.RegularExpressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.Text.RegularExpressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.Text.RegularExpressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanoframework","download_url":"https://codeload.github.com/nanoframework/System.Text.RegularExpressions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.Text.RegularExpressions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279129503,"owners_count":26109999,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","dotnet","hacktoberfest","library","nanoframework","parser","regex"],"created_at":"2024-11-09T17:22:56.512Z","updated_at":"2025-10-15T23:42:06.230Z","avatar_url":"https://github.com/nanoframework.png","language":"C#","funding_links":["https://opencollective.com/nanoframework","https://github.com/sponsors/nanoframework"],"categories":[],"sub_categories":[],"readme":"[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.System.Text.RegularExpressions\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.System.Text.RegularExpressions) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.System.Text.RegularExpressions\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.System.Text.RegularExpressions) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.System.Text.RegularExpressions.svg?label=NuGet\u0026style=flat\u0026logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Text/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md)\n[![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord\u0026logoColor=white\u0026label=Discord\u0026color=7289DA)](https://discord.gg/gCyBu8T)\n\n![nanoFramework logo](https://raw.githubusercontent.com/nanoframework/Home/main/resources/logo/nanoFramework-repo-logo.png)\n\n-----\n\n### Welcome to the .NET **nanoFramework** System.Text.RegularExpressions repository\n\n## Build status\n\n| Component | Build Status | NuGet Package |\n|:-|---|---|\n| System.Text.RegularExpressions | [![Build Status](https://dev.azure.com/nanoframework/System.Text.RegularExpressions/_apis/build/status/System.Text.RegularExpressions?repoName=nanoframework%2FSystem.Text.RegularExpressions\u0026branchName=main)](https://dev.azure.com/nanoframework/System.Text.RegularExpressions/_build/latest?definitionId=69\u0026repoName=nanoframework%2FSystem.Text.RegularExpressions\u0026branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Text.RegularExpressions.svg?label=NuGet\u0026style=flat\u0026logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Text.RegularExpressions/) |\n\n**Important**: This Regular Expressions parser will cover most of your needs. It has some limitation when the pattern is complex and not a full compatibility. This is an on going work, mainly built on the .NET Microframework implementation. Please do not hesitate to raise any issue if any issue. Also, any help to improve this parser it's more than welcome.\n\nIn the [Tests](./Tests) you will find advance tests, so far only one is failing. Help to fix the parser needed!\n\n## Usage\n\nThe level of compatibility with the full framework is high. The `Match`, `Group` classes are working as you can expect. The following examples gives an idea of the usage:\n\n```csharp\n// The example displays the following output:\n//       Match: This is one sentence.\n//          Group 1: 'This is one sentence.'\n//             Capture 1: 'This is one sentence.'\n//          Group 2: 'sentence'\n//             Capture 1: 'This '\n//             Capture 2: 'is '\n//             Capture 3: 'one '\n//             Capture 4: 'sentence'\n//          Group 3: 'sentence'\n//             Capture 1: 'This'\n//             Capture 2: 'is'\n//             Capture 3: 'one'\n//             Capture 4: 'sentence'\nstring pattern = @\"(\\b(\\w+?)[,:;]?\\s?)+[?.!]\";\nstring input = \"This is one sentence. This is a second sentence.\";\n\nMatch match = Regex.Match(input, pattern);\nDebug.WriteLine(\"Match: \" + match.Value);\nint groupCtr = 0;\nforeach (Group group in match.Groups)\n{\n    groupCtr++;\n    Debug.WriteLine(\"   Group \" + groupCtr + \": '\" + group.Value + \"'\");\n    int captureCtr = 0;\n    foreach (Capture capture in group.Captures)\n    {\n        captureCtr++;\n        Debug.WriteLine(\"      Capture \" + captureCtr + \": '\" + capture.Value + \"'\");\n    }\n}\n```\n\nAnother example using `Split`:\n\n```csharp\nregex = new Regex(\"[ab]+\");\nacutalResults = regex.Split(\"xyzzyababbayyzabbbab123\");\nfor (int i = 0; i \u003c acutalResults.Length; i++)\n{\n    Debug.WriteLine($\"{acutalResults[i]}\");\n}\n// The results will be:\n// xyzzy\n// yyz\n// 123\n```\n\nYou can as well use the `Replace` function:\n\n```csharp\nregex = new Regex(\"a*b\");\nactual = regex.Replace(\"aaaabfooaaabgarplyaaabwackyb\", \"-\");\nDebug.WriteLine($\"{actual}\");\nregex = new Regex(\"([a-b]+?)([c-d]+)\");\nactual = regex.Replace(\"zzabcdzz\", \"$1-$2\");\nDebug.WriteLine($\"{actual}\");\n// The result will be:\n// -foo-garply-wacky-\n// zzab-cdzz\n```\n\nThe next example shows the possibility to use options:\n\n```csharp\nregex = new Regex(\"abc(\\\\w*)\");\nDebug.WriteLine(\"RegexOptions.IgnoreCase abc(\\\\w*)\");\nregex.Options = RegexOptions.IgnoreCase;\nif (regex.IsMatch(\"abcddd\"))\n{\n    Debug.WriteLine(\"abcddd = true\");\n}\nregex = new Regex(\"^abc$\", RegexOptions.Multiline);\nif (regex.IsMatch(\"\\nabc\"))\n{\n    Debug.WriteLine(\"abc found!\");\n}\n// The result will be:\n// abcddd = true\n// abc found!\n```\n\n## Validated regular expressions\n\nYou'll find in the tests some regular expressions used. Those can be useful:\n\n- email addresses: `([\\w\\d_.\\-]+)@([\\d\\w\\.\\-]+)\\.([\\w\\.]{2,5})`\n- http(s) URL: `(https?:\\/\\/)([\\da-z-._]+)/?([\\/\\da-z.-]*)` (limitation: URL has to finish with a / to be properly extracted, this is a bug into our engine, it works perfectly with the expression between ^ and $)\n- MD5: `[a-f0-9]{32}`\n- SHA256: `[A-Fa-f0-9]{64}`\n- Simple XML tag: `\u003ctag\u003e[^\u003c]*\u003c/tag\u003e`\n- GUID: `[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?`\n- Date time like `2021-04-10 18:08:42`: `(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})`\n\n## Known limitations\n\nThis parser is a simple one, some of those elements are not supported:\n\n- Expressions like `(?\u003cword\u003e\\w+)` will not work. While groups are supported, the `?` in front of a named group or element is not supported.\n- For some characters, when using the escaped version like `\\.` you may encounter issues, just use `.` instead.\n- Sometimes the order of the characters may have an impact. If you are in this case, try to change the order in a character class like `[a-z-._]`\n\n## Feedback and documentation\n\nFor documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).\n\nJoin our Discord community [here](https://discord.gg/gCyBu8T).\n\n## Credits\n\nThe list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/main/CONTRIBUTORS.md).\n\n## License\n\nThe **nanoFramework** Class Libraries are licensed under the [MIT license](LICENSE.md).\n\nPlease check the header of the files in this repository, some of the code is under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n## Code of Conduct\n\nThis project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community.\nFor more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).\n\n## .NET Foundation\n\nThis project is supported by the [.NET Foundation](https://dotnetfoundation.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoframework%2Fsystem.text.regularexpressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanoframework%2Fsystem.text.regularexpressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoframework%2Fsystem.text.regularexpressions/lists"}