string: Allow references to unmatched groups in REGEX REPLACE

References to unmatched groups will be replaced with empty strings.

Issue: #26629
Fixes: #19012
This commit is contained in:
Nikita Nemkin
2025-02-14 22:13:18 +05:00
parent 8845d33292
commit ca65fa9a7f
5 changed files with 13 additions and 5 deletions
+3
View File
@@ -122,6 +122,9 @@ Search and Replace With Regular Expressions
string instead of the beginning of each repeated search.
See policy :policy:`CMP0186`.
The replacement expression may contain references to subexpressions that
didn't match anything. Previously, such references triggered an error.
.. _`Regex Specification`:
Regex Specification