From ac1f4780931b310505b2f8bf8a5cdec8a88ee587 Mon Sep 17 00:00:00 2001 From: "Denis Kuzmin [ GitHub/3F ]" Date: Mon, 8 Mar 2021 00:45:09 +0300 Subject: [PATCH] Public release. regXwild 1.4 * NEW: Modern `match()` method for ESS implementation with bitwise options: ``` bool match(const tstring& input, const tstring& pattern, const EngineOptions& options, MatchResult* result); ``` Searches an input string for a substring that matches a pattern. Use F_ICASE = 0x001 to ignore case sensitivity when matching. * NEW: Implemented `>c` metasymbol. Modern `>` as [^c]*str | [^c]*$ This is default behavior using match(). To activate legacy `>` as [^/]*str | [^/]*$ use F_LEGACY_ANYSP = 0x080 * NEW: Implemented F_MATCH_RESULT = 0x002 flag to collect additional data for the MatchResult. ``` EssRxW::MatchResult m; rxw.match ( _T("number = '8888'; //TODO: up"), _T("'+'"), EssRxW::EngineOptions::F_MATCH_RESULT, &m ); //m.start = 9 //m.end = 15 ``` * NEW: Added `replace()` method for ESS implementation. ``` bool replace(tstring& input, const tstring& pattern, const tstring& replacement, const EngineOptions& options); ``` In a specified input, replaces first substring that match a specified pattern with a specified replacement string. * NEW: Implemented optional offset for `match()` and `replace()` methods. ESS impl. ``` bool replace(tstring& input, const tstring& pattern, const tstring& replacement, udiff_t offset, const EngineOptions& options) bool match(const tstring& input, const tstring& pattern, udiff_t offset, const EngineOptions& options, MatchResult* result) ``` udiff_t offset - The starting position to start matching. * NEW: Implemented F_MATCH_ALL = 0x004. Do not finish on first match in replace() method. * NEW: New C-export functions in common.h PE/Invoke or other outside environments. ``` bool replace(TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, flagcfg_t options); bool replaceOfs(TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, udiff_t offset, flagcfg_t options); bool match(const TCHAR* input, const TCHAR* pattern, flagcfg_t options, EssRxW::MatchResult* result); bool matchOfs(const TCHAR* input, const TCHAR* pattern, udiff_t offset, flagcfg_t options, EssRxW::MatchResult* result); bool replaceTo(const TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, TCHAR* to, udiff_t offset, flagcfg_t options); ``` * FIXED: Fixed SINGLE ms for +++ and `system+` or like. * FIXED: Fixed END ms `$` and BEGIN ms `^` when using other available ms. * FIXED: Fixed ##?? ++?? for " = 12" -> "= 123". * FIXED: Fixed an early return when matching. * FIXED: Fixed Compiler Error such C2758 etc for C99/MSVC10 compilers (VS2010). * FIXED: Fixed NuGet package use for native C/C++ projects. * CHANGED: Implemented MS combinations for END $ such as *$, ??$, +$. * CHANGED: Implemented MS combinations for BEGIN ^ such as ^+, ^#, ^?. * CHANGED: Added aliases EssRxW/ExtRxW/RxW to the main algorithms. * CHANGED: Added RXW_UNICODE for user targets when CharacterSet is Unicode. * CHANGED: `AlgorithmEss::search()` was marked as obsolete and can be removed in future major versions. * CHANGED: regXwildAPI.h was marked as obsolete. Please use regXwild.common.h or regXwild.h. * CHANGED: Most our types are spaced now as regXwild::rxwtypes. * NOTE: You can find various flexible use for .NET in our new dotnet-test project through Conari engine: https://github.com/3F/Conari https://github.com/3F/regXwild --- .version | 2 +- Readme.md | 4 +- changelog.txt | 84 ++++++++++++++++++++++++++++++++++++ regXwild/RXWVersion.h | 4 +- regXwild/regXwild.common.cpp | 2 +- regXwild/regXwild.rc | 8 ++-- 6 files changed, 94 insertions(+), 10 deletions(-) diff --git a/.version b/.version index 589268e..e21e727 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.3.0 \ No newline at end of file +1.4.0 \ No newline at end of file diff --git a/Readme.md b/Readme.md index e8790f6..45867b3 100644 --- a/Readme.md +++ b/Readme.md @@ -120,12 +120,12 @@ Play with our actual **Unit-Tests**. 1.4+ ```cpp -EssRxW::Match m; +EssRxW::MatchResult m; rxw.match ( _T("number = '8888'; //TODO: up"), _T("'+'"), - EssRxW::FlagsRxW::F_MATCH_RESULT, + EssRxW::EngineOptions::F_MATCH_RESULT, &m ); //m.start = 9 diff --git a/changelog.txt b/changelog.txt index 54323e7..84265d3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,90 @@ regXwild - https://github.com/3F/regXwild - - - - - - - - - - - - - - - - - - - - - +[v1.4] 2021.03.07 + + * NEW: Modern `match()` method for ESS implementation with bitwise options: + ``` + bool match(const tstring& input, const tstring& pattern, const EngineOptions& options, MatchResult* result); + ``` + Searches an input string for a substring that matches a pattern. + Use F_ICASE = 0x001 to ignore case sensitivity when matching. + + * NEW: Implemented `>c` metasymbol. + Modern `>` as [^c]*str | [^c]*$ + + This is default behavior using match(). + To activate legacy `>` as [^/]*str | [^/]*$ use F_LEGACY_ANYSP = 0x080 + + * NEW: Implemented F_MATCH_RESULT = 0x002 flag to collect additional data for the MatchResult. + ``` + EssRxW::MatchResult m; + rxw.match + ( + _T("number = '8888'; //TODO: up"), + _T("'+'"), + EssRxW::EngineOptions::F_MATCH_RESULT, + &m + ); + //m.start = 9 + //m.end = 15 + ``` + + * NEW: Added `replace()` method for ESS implementation. + ``` + bool replace(tstring& input, const tstring& pattern, const tstring& replacement, const EngineOptions& options); + ``` + In a specified input, replaces first substring that match a specified pattern with a specified replacement string. + + * NEW: Implemented optional offset for `match()` and `replace()` methods. ESS impl. + ``` + bool replace(tstring& input, const tstring& pattern, const tstring& replacement, udiff_t offset, const EngineOptions& options) + bool match(const tstring& input, const tstring& pattern, udiff_t offset, const EngineOptions& options, MatchResult* result) + ``` + udiff_t offset - The starting position to start matching. + + * NEW: Implemented F_MATCH_ALL = 0x004. Do not finish on first match in replace() method. + + * NEW: New C-export functions in common.h PE/Invoke or other outside environments. + ``` + bool replace(TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, flagcfg_t options); + bool replaceOfs(TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, udiff_t offset, flagcfg_t options); + bool match(const TCHAR* input, const TCHAR* pattern, flagcfg_t options, EssRxW::MatchResult* result); + bool matchOfs(const TCHAR* input, const TCHAR* pattern, udiff_t offset, flagcfg_t options, EssRxW::MatchResult* result); + bool replaceTo(const TCHAR* input, const TCHAR* pattern, const TCHAR* replacement, TCHAR* to, udiff_t offset, flagcfg_t options); + ``` + + * FIXED: Fixed SINGLE ms for +++ and `system+` or like. + + * FIXED: Fixed END ms `$` and BEGIN ms `^` when using other available ms. + + * FIXED: Fixed ##?? ++?? for " = 12" -> "= 123". + + * FIXED: Fixed an early return when matching. + + * FIXED: Fixed Compiler Error such C2758 etc for C99/MSVC10 compilers (VS2010). + + * FIXED: Fixed NuGet package use for native C/C++ projects. + + * CHANGED: Implemented MS combinations for END $ such as *$, ??$, +$. + + * CHANGED: Implemented MS combinations for BEGIN ^ such as ^+, ^#, ^?. + + * CHANGED: Added aliases EssRxW/ExtRxW/RxW to the main algorithms. + + * CHANGED: Added RXW_UNICODE for user targets when CharacterSet is Unicode. + + * CHANGED: `AlgorithmEss::search()` was marked as obsolete and can be removed in future major versions. + + * CHANGED: regXwildAPI.h was marked as obsolete. Please use regXwild.common.h or regXwild.h. + + * CHANGED: Most our types are spaced now as regXwild::rxwtypes. + + * NOTE: You can find various flexible use for .NET in our new dotnet-test project through Conari engine: + https://github.com/3F/Conari + https://github.com/3F/regXwild + + [v1.3] 2020.08.10 * NEW: Quantifiers are now standardized as follows: diff --git a/regXwild/RXWVersion.h b/regXwild/RXWVersion.h index adb779d..b714130 100644 --- a/regXwild/RXWVersion.h +++ b/regXwild/RXWVersion.h @@ -19,7 +19,7 @@ namespace net { namespace r_eg { namespace regXwild const int patch; const int build; - TNum() : major(1), minor(3), patch(0), build(0) { } + TNum() : major(1), minor(4), patch(0), build(0) { } } number; @@ -27,7 +27,7 @@ namespace net { namespace r_eg { namespace regXwild const rxwtypes::TCHAR* config; const rxwtypes::TCHAR* product; - RXWVersion() : bSha1(_T("")), config(_T("")), product(_T("1.3.0")) { } + RXWVersion() : bSha1(_T("")), config(_T("")), product(_T("1.4.0")) { } }; }}} diff --git a/regXwild/regXwild.common.cpp b/regXwild/regXwild.common.cpp index 22cf6d8..9df43ac 100644 --- a/regXwild/regXwild.common.cpp +++ b/regXwild/regXwild.common.cpp @@ -255,7 +255,7 @@ namespace net { namespace r_eg { namespace regXwild { namespace common */ REGXWILD_API_L const rxwtypes::TCHAR* versionString() { - return /*vsSBE*/_T("1.3.0"); + return /*vsSBE*/_T("1.4.0"); } }}}} \ No newline at end of file diff --git a/regXwild/regXwild.rc b/regXwild/regXwild.rc index 16dc6f1..56bbd0d 100644 --- a/regXwild/regXwild.rc +++ b/regXwild/regXwild.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,3,0,0 - PRODUCTVERSION 1,3,0,0 + FILEVERSION 1,4,0,0 + PRODUCTVERSION 1,4,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "github.com/3F" VALUE "FileDescription", "https://github.com/3F/regXwild" - VALUE "FileVersion", "1.3.0.0" + VALUE "FileVersion", "1.4.0.0" VALUE "InternalName", "regXwild.dll" VALUE "LegalCopyright", "Copyright (c) 2013-2021 Denis Kuzmin github/3F" VALUE "OriginalFilename", "regXwild.dll" VALUE "ProductName", "regXwild" - VALUE "ProductVersion", "1.3.0" + VALUE "ProductVersion", "1.4.0" END END BLOCK "VarFileInfo"