Skip to content

Commit

Permalink
tg_cpphost: RegEXHandler: Additionally OR the match_not_null
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Nov 21, 2023
1 parent 118e8be commit 1f3c4a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RegEXHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ struct RegEXContext {

using std::regex_constants::format_sed;
using std::regex_constants::format_first_only;
using std::regex_constants::match_not_null;

static std::string doRegex(const RegEXContext* ctx, const std::string& text) {
std::string s = text;
auto flags = format_sed;
auto flags = format_sed | match_not_null;
if (!ctx->global)
flags |= format_first_only;
return std::regex_replace(text, ctx->src, ctx->dest, flags);
Expand Down

0 comments on commit 1f3c4a6

Please sign in to comment.