mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
string: Allow zero-length matches in all REGEX subcommands
The semantics mimic other languages like Python, Java, JS, etc. To advance past a zero-length match, the search algorithm first tries to find a non-zero alternative branch. If that fails, it force-advances by 1 character. Fixes: #13790, #13792, #18690, #26629
This commit is contained in:
@@ -122,6 +122,9 @@ Search and Replace With Regular Expressions
|
||||
string instead of the beginning of each repeated search.
|
||||
See policy :policy:`CMP0186`.
|
||||
|
||||
Zero-length matches are allowed in ``MATCHALL`` and ``REPLACE``.
|
||||
Previously, they triggered an error.
|
||||
|
||||
The replacement expression may contain references to subexpressions that
|
||||
didn't match anything. Previously, such references triggered an error.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user