summaryrefslogtreecommitdiffstats
path: root/modules/regex/regex.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-20 15:47:08 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-20 15:47:08 +0100
commit12de2f1f70c2e9e997042a36143c4fbb533ade95 (patch)
tree08e79c15cc1197869860ae40272f868bdd20cf75 /modules/regex/regex.cpp
parentb787fc63fda7634bf821879e871c60a1d53c7957 (diff)
parent46b420f7ee5361819b11dff50e6ffbb038f85696 (diff)
downloadredot-engine-12de2f1f70c2e9e997042a36143c4fbb533ade95.tar.gz
Merge pull request #86052 from TheSofox/regex-sub-fix
Fix `RegEx.sub` truncating string when `end` is used
Diffstat (limited to 'modules/regex/regex.cpp')
-rw-r--r--modules/regex/regex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index d49578d2a9..4a1037431a 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -334,7 +334,7 @@ String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_a
return String();
}
- return String(output.ptr(), olength);
+ return String(output.ptr(), olength) + p_subject.substr(length);
}
bool RegEx::is_valid() const {