mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-17 20:50:43 -06:00
When `string(REGEX REPLACE)` or `string(REGEX MATCHALL)` loop internally, they store their matches, but they do not clear the previous match from an earlier iteration. This can leave the contents of `CMAKE_MATCH_<N>` with bogus values for later matches in the string if they have groups which earlier matched a non-empty string, but now match an empty string. Fixes #17079.
13 lines
334 B
Plaintext
13 lines
334 B
Plaintext
^matches: Some::;Scope
|
|
results from: string\(REGEX MATCHALL\)
|
|
CMAKE_MATCH_0: -->Scope<--
|
|
CMAKE_MATCH_1: -->Scope<--
|
|
CMAKE_MATCH_2: --><--
|
|
CMAKE_MATCH_COUNT: -->1<--
|
|
replace: \[Some\]\[Scope\]
|
|
results from: string\(REGEX REPLACE\)
|
|
CMAKE_MATCH_0: -->Scope<--
|
|
CMAKE_MATCH_1: -->Scope<--
|
|
CMAKE_MATCH_2: --><--
|
|
CMAKE_MATCH_COUNT: -->1<--$
|