mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 00:00:39 -05:00
regex: Match ^ at most once in repeated searches
When doing successive matches, track the input start and current search start positions separately to prevent the `^` anchor from matching in the middle of the string. Add policy CMP0186 to provide compatibility. Issue: #26629 Fixes: #16899
This commit is contained in:
@@ -117,6 +117,11 @@ Search and Replace With Regular Expressions
|
||||
two backslashes (``\\1``) are required in CMake code to get a backslash
|
||||
through argument parsing.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
The ``^`` anchor now matches only at the beginning of the input
|
||||
string instead of the beginning of each repeated search.
|
||||
See policy :policy:`CMP0186`.
|
||||
|
||||
.. _`Regex Specification`:
|
||||
|
||||
Regex Specification
|
||||
|
||||
Reference in New Issue
Block a user