MantisBT - CMake
View Issue Details
0013792CMakeCMakepublic2012-12-13 16:262016-06-10 14:31
mwoehlke 
Kitware Robot 
normalminoralways
closedmoved 
CMake 2.8.10 
 
0013792: REGEX REPLACE fails if () capture is empty
string(REGEX REPLACE) fails for certain patterns with 'matched an empty string' error if a capture grood is empty, even if the full match is non-empty.
set(input foo)
string(REGEX REPLACE "^([^.]*)(\\..*)?$" "\\1" output ${input})
CMake is correctly matching the regular expression (as can be seen by examining the captures), and the overall pattern (which is the old text to be replaced) is non-empty, so there should be no problem. (Even more interestingly, while the above pattern triggers the problem, other patterns which one might expect to tickle the same glitch do not.)
No tags attached.
Issue History
2012-12-13 16:26mwoehlkeNew Issue
2016-06-10 14:28Kitware RobotNote Added: 0042171
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042171)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.