{"id":16974730,"url":"https://github.com/3f/regxwild","last_synced_at":"2025-10-28T18:14:08.991Z","repository":{"id":46747877,"uuid":"68608415","full_name":"3F/regXwild","owner":"3F","description":"⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.","archived":false,"fork":false,"pushed_at":"2021-07-18T18:05:22.000Z","size":435,"stargazers_count":26,"open_issues_count":6,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T12:02:54.346Z","etag":null,"topics":["conari","fast-regex","fast-search","filter","glob","match","regex","regexp","regxwild","replace-text","search","search-in-text","speed","strings","text","wildcard","wildcard-matches","wildcard-replace","wildcard-searches","wildcards"],"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/3F.png","metadata":{"files":{"readme":"Readme.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"github3f","custom":["3F.github.io/Donation/"]}},"created_at":"2016-09-19T13:27:17.000Z","updated_at":"2025-01-17T09:44:52.000Z","dependencies_parsed_at":"2022-09-09T22:22:02.688Z","dependency_job_id":null,"html_url":"https://github.com/3F/regXwild","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2FregXwild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2FregXwild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2FregXwild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2FregXwild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3F","download_url":"https://codeload.github.com/3F/regXwild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244972081,"owners_count":20540918,"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":["conari","fast-regex","fast-search","filter","glob","match","regex","regexp","regxwild","replace-text","search","search-in-text","speed","strings","text","wildcard","wildcard-matches","wildcard-replace","wildcard-searches","wildcards"],"created_at":"2024-10-14T01:07:49.062Z","updated_at":"2025-10-28T18:14:08.875Z","avatar_url":"https://github.com/3F.png","language":"C++","funding_links":["https://ko-fi.com/github3f","3F.github.io/Donation/"],"categories":[],"sub_categories":[],"readme":"\n# [regXwild](https://github.com/3F/regXwild) \n\n⏱ Superfast ^Advanced wildcards++? `*`,`|`,`?`,`^`,`$`,`+`,`#`,`\u003e`,[`++??`](https://github.com/3F/regXwild/pull/7),[`##??`](https://github.com/3F/regXwild/pull/7),`\u003ec` in addition to slow regex engines and more.\n\n✔ regex-like quantifiers, amazing meta symbols, and speed...\n\nUnique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET through **[Conari](https://github.com/3F/Conari)** (recommended due to caching of 0x29 opcodes + related optimizations), and others such as [python](https://github.com/3F/regXwild/issues/6) etc.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/8knio1ggle0o8ugh/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/regxwild-github/branch/master)\n[![release](https://img.shields.io/github/v/release/3F/regXwild)](https://github.com/3F/regXwild/releases/latest)\n[![License](https://img.shields.io/badge/License-MIT-74A5C2)](https://github.com/3F/regXwild/blob/master/LICENSE)\n[![NuGet package](https://img.shields.io/nuget/v/regXwild)](https://www.nuget.org/packages/regXwild/)\n[![Tests](https://img.shields.io/appveyor/tests/3Fs/regxwild-github/master)](https://ci.appveyor.com/project/3Fs/regxwild-github/build/tests)\n\n[![Build history](https://buildstats.info/appveyor/chart/3Fs/regxwild-github?buildCount=20\u0026includeBuildsFromPullRequest=true\u0026showStats=true)](https://ci.appveyor.com/project/3Fs/regxwild-github/history)\n\nSamples [⏯](regXwildTest/EssSamplesTest.cpp) | regXwild filter | n\n----------------------|----------------------|---------\nnumber = '1271';      | number = '????';     |  0 - 4\nyear = '2020';        | '##'\\|'####'         |  2 \\| 4\nyear = '20';          | = '##??'             |  2 \\| 4\nnumber = 888;         | number = +??;        |  1 - 3\n\n\nSamples [⏯](regXwildTest/EssSamplesTest.cpp) | regXwild filter\n----------------------|----------------------\neverything is ok      | ^everything\\*ok$\nsystems               | system?\nsystems               | sys###s\nA new 'X1' project    | ^A\\*'+' pro?ect\nprofessional system   | pro\\*system\nregXwild in action    | pro?ect$\\|open\\*source+act\\|^regXwild\n\n\n## Why regXwild ?\n\nIt was designed to be faster than just fast for features that usually go beyond the typical wildcards. Seriously, We love regex, I love, You love; 2013 far behind but regXwild still relevant for speed and powerful wildcards-like features, such as `##??` (which means 2 or 4) ...\n\n### 🔍 Easy to start\n\nUnmanaged native C++ or managed .NET project. It doesn't matter, just use it:\n\nC++\n```cpp\n#include \u003cregXwild.h\u003e\nusing namespace net::r_eg::regXwild;\n...\nEssRxW rxw;\nif(rxw.match(_T(\"regXwild\"), _T(\"reg?wild\"))) {\n    // ...\n}\n```\n\nC# if [Conari](https://github.com/3F/Conari)\n```csharp\nusing dynamic l = new ConariX(\"regXwild.dll\");\n...\nif(l.match\u003cbool\u003e(\"regXwild\", \"reg?wild\")) {\n    // ...\n}\n```\n\n### 🏄 Amazing meta symbols\n\nESS version (advanced EXT version)\n\nmetasymbol | meaning\n-----------|----------------\n\\*         | {0, ~}\n\\|         | str1 or str2 or ...\n?          | {0, 1}, ??? {0, 3}, ...\n^          | [str... or [str1... |[str2...\n$          | ...str] or ...str1]| ...str2]\n\\+         | {1, ~}, +++ {3, ~}, ...\n\\#         | {1}, ## {2}, ### {3}, ...\n\\\u003e         | Legacy `\u003e` (F_LEGACY_ANYSP = 0x008) as *[^/]\\*str \\| [^/]\\*$*\n\\\u003ec        | 1.4+ Modern `\u003e` as *[^**c**]\\*str \\| [^**c**]\\*$*\n\nEXT version (more simplified than ESS)\n\nmetasymbol | meaning\n-----------|----------------\n\\*         | {0, ~}\n\\\u003e         | as [^/\\\\]+\n\\|         | str1 or str2 or ...\n?          | {0, 1}, ??? {0, 3}, ...\n\n\n### 🧮 Quantifiers\n\n1.3+ [`++??`](https://github.com/3F/regXwild/pull/7); [`##??`](https://github.com/3F/regXwild/pull/7)\n\nregex           | regXwild   | n\n----------------|------------|---------\n.\\*             | \\*         | 0+\n.+              | +          | 1+\n.?              | ?          | 0 \\| 1\n.{1}            | #          | 1\n.{2}            | ##         | 2\n.{2, }          | ++         | 2+\n.{0, 2}         | ??         | 0 - 2\n.{2, 4}         | ++??       | 2 - 4\n(?:.{2}\\|.{4})  | ##??       | 2 \\| 4\n.{3, 4}         | +++?       | 3 - 4\n(?:.{1}\\|.{3})  | #??        | 1 \\| 3\n\nand similar ...\n\nPlay with our actual **Unit-Tests**.\n\n### 🚀 Awesome speed\n\n* [~2000 times faster when C++](#speed).\n* For .NET (including modern .NET Core), [Conari](https://github.com/3F/Conari) provides optional caching of 0x29 opcodes (Calli) and more to get similar to C++ result as possible.\n\n### Match result and Replacements\n\n1.4+\n\n```cpp\nEssRxW::MatchResult m;\nrxw.match\n(\n    _T(\"number = '8888'; //TODO: up\"),\n    _T(\"'+'\"),\n    EssRxW::EngineOptions::F_MATCH_RESULT,\n    \u0026m\n);\n//m.start = 9\n//m.end = 15\n...\ninput.replace(m.start, m.end - m.start, _T(\"'9777'\"));\n```\n\n```cpp\ntstring str = _T(\"year = 2021; dd = 17;\");\n...\nif(rxw.replace(str, _T(\" ##;\"), _T(\" 00;\"))) {\n    // year = 2021; dd = 00;\n}\n```\n\n### 🍰 Open and Free\n\nOpen Source project; MIT License, Enjoy 🎉\n\n## License\n\nThe [MIT License (MIT)](https://github.com/3F/regXwild/blob/master/LICENSE)\n\n```\nCopyright (c) 2013-2021  Denis Kuzmin \u003cx-3F@outlook.com\u003e github/3F\n```\n\n[ [ ☕ Make a donation ](https://3F.github.io/Donation/) ]\n\nregXwild contributors: https://github.com/3F/regXwild/graphs/contributors\n\nWe're waiting for your awesome contributions!\n\n## Speed\n\n### Procedure of testing\n\n* Use the `algo` subproject as tester of the main algorithms (***Release*** *cfg - x32 \u0026 x64*)\n* In general, calculation is simple and uses average as `i = (t2 - t1); (sum(i) / n)` where:\n    * **i** - one iteration for searching by filter. Represents the delta of time `t2 - t1`\n    * **n** - the number of repeats of the matching to get average.\n\ne.g.:\n\n```cpp\n{\n    Meter meter;\n    int results = 0;\n\n    for(int total = 0; total \u003c average; ++total)\n    {\n        meter.start();\n        for(int i = 0; i \u003c iterations; ++i)\n        {\n            if((alg.*method)(data, filter)) {\n                //...\n            }\n        }\n        results += meter.delta();\n    }\n\n    TRACE((results / average) \u003c\u003c \"ms\");\n}\n```\n\nfor regex results it also prepares additional `basic_regex` from filter, but of course, **only one for all iterations**:\n\n```cpp\nmeter.start();\n\nauto rfilter = tregex(\n    filter,\n    regex_constants::icase | regex_constants::optimize\n);\n\nresults += meter.delta();\n...\n```\n\nPlease note:\n\n* **+icase** means ignore case sensitivity when matching the filter(pattern) within the searched string, i.e. `ignoreCase = true`. **Without** this, everything **will be much faster** of course. *That is, icase always adds complexity.*\n* Below, **MultiByte** can be faster than **Unicode** (for the same platform and the same way of module use) but it depends on specific architecture and can be about ~2 times faster when native C++, and about ~4 times faster when .NET + Conari and related.\n* The results below can be different on different machines. You need only look at the difference (in milliseconds) between algorithms for a specific target.\n* To calculate the data, as in the table below, you need execute `algo.exe`\n\n### Sample of speed for Unicode\n\n340 Unicode Symbols and 10^4 iterations (340 x 10000); Filter: `L\"nime**haru*02*Magica\"`\n\n\n algorithms (see impl. from `algo`)       | +icase [x32]| +icase [x64]\n------------------------------------------|-------------|-------------\nFind + Find                               | ~58ms       | ~44ms       \nIterator + Find                           | ~57ms       | ~46ms       \nGetline + Find                            | ~59ms       | ~54ms       \nIterator + Substr                         | ~165ms      | ~132ms      \nIterator + Iterator                       | ~136ms      | ~118ms      \nmain :: based on Iterator + Find          | ~53ms       | ~45ms       \n​ ​                                         | ​            | \n**Final algorithm - EXT version:**        | **~50ms**   | **~26ms**   \n**Final algorithm - ESS version:**        | **~50ms**   | **~27ms**   \n​ ​                                         | ​            | \nregexp-c++11(regex_search)                | ~59309ms    | ~53334ms    \nregexp-c++11(only as ^match$ like a '==') | ~12ms       | ~5ms        \nregexp-c++11(regex_match with endings .*) | ~59503ms    | ~53817ms    \n\n\n**ESS vs EXT**\n\n350 Unicode Symbols and 10^4 iterations (350 x 10000);\n\nOperation (+icase)    | EXT  [x32] | ESS  [x32] | EXT  [x64] | ESS  [x64] \n----------------------|------------|------------|------------|------------\nANY                   | ~54ms      | ~55ms      | ~32ms      | ~34ms\nANYSP                 | ~60ms      | ~59ms      | ~37ms      | ~38ms\nONE                   | ~56ms      | ~56ms      | ~33ms      | ~35ms\nSPLIT                 | ~92ms      | ~94ms      | ~58ms      | ~63ms\nBEGIN                 | ---        | ~38ms      | ---        | ~19ms\nEND                   | ---        | ~39ms      | ---        | ~21ms\nMORE                  | ---        | ~44ms      | ---        | ~23ms\nSINGLE                | ---        | ~43ms      | ---        | ~22ms\n\n\n**For .NET users through [Conari](https://github.com/3F/Conari) engine:** \n\n*Same test Data \u0026 Filter: 10^4 iterations* \n\n*Release cfg; x32 or x64 regXwild (Unicode)*\n\n**Attention:** For more speed you need upgrading to [Conari **1.3**](https://github.com/3F/Conari/commit/4f14cecbcea75895a510954c2cd402ee0e9e3521) or higher !\n\n algorithms  (see impl. from `snet`)        | +icase [x32] | +icase [x64] | ​  \n--------------------------------------------|--------------|--------------|---\nregXwild via Conari v1.2 (Lambda) - ESS     | ~1032ms      | ~1418ms      | x\nregXwild via Conari v1.2 (DLR) - ESS        | ~1238ms      | ~1609ms      | x\nregXwild via Conari v1.2 (Lambda) - EXT     | ~1117ms      | ~1457ms      | x\nregXwild via Conari v1.2 (DLR) - EXT        | ~1246ms      | ~1601ms      | x\n​ ​                                           | ​             |  ​            |\nregXwild via Conari **v1.3** (Lambda) - ESS | **~58ms**    | **~42ms**    | `\u003c\u003c`\nregXwild via Conari **v1.3** (DLR) - ESS    | ~218ms       | ~234ms       |\nregXwild via Conari **v1.3** (Lambda) - EXT | **~54ms**    | **~35ms**    | `\u003c\u003c`\nregXwild via Conari **v1.3** (DLR) - EXT    | ~214ms       | ~226ms       |\n​ ​                                           | ​             |  ​            |\n.NET Regex engine [Compiled]                | ~38310ms     | ~37242ms     |\n.NET Regex engine [Compiled]{only ^match$}  | \u003c 1ms        | ~3ms         |\n.NET Regex engine                           | ~31565ms     | ~30975ms     |\n.NET Regex engine {only ^match$}            | \u003c 1ms        | ~1ms         |\n\n\n### How to get regXwild\n\nregXwild v1.1+ can also be installed through **NuGet** same for both unmanaged and managed projects.\n\nFor .NET it will put x32 \u0026 x64 regXwild into $(TargetDir). Use it with your .net modules through [Conari](https://github.com/3F/Conari) and so on.\n\nx64 + x32 Unicode + MultiByte modules;\n\nPlease note: Modern regXwild packages will no longer be distributed together with [Conari](https://github.com/3F/Conari). Please consider to use it separately, [Conari nuget packages](https://www.nuget.org/packages/Conari/).\n\n* regXwild NuGet: [![NuGet package](https://img.shields.io/nuget/v/regXwild.svg)](https://www.nuget.org/packages/regXwild/)\n* [GetNuTool](https://github.com/3F/GetNuTool): `msbuild gnt.core /p:ngpackages=\"regXwild\"` or **[gnt](https://3f.github.io/GetNuTool/releases/latest/gnt/)** /p:ngpackages=\"regXwild\"\n* [GitHub Releases](https://github.com/3F/regXwild/releases) [ [latest](https://github.com/3F/regXwild/releases/latest) ]\n* 🎲 CI builds: [`CI /artifacts`](https://ci.appveyor.com/project/3Fs/regxwild-github/history) ( [old CI](https://ci.appveyor.com/project/3Fs/regxwild/history) )","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3f%2Fregxwild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3f%2Fregxwild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3f%2Fregxwild/lists"}