The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=13790 ====================================================================== Reported By: mwoehlke Assigned To: ====================================================================== Project: CMake Issue ID: 13790 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2012-12-13 13:48 EST Last Modified: 2012-12-13 13:48 EST ====================================================================== Summary: regex replace does not allow anchored empty matches Description: string(REGEX REPLACE) fails with error 'string sub-command REGEX, mode REPLACE regex <pattern> matched an empty string.' when the regular expression is anchored. Since the position of the match is non-ambiguous when an anchor is present, the replace should succeed, even if the substring being replaced is empty. (Other tools, e.g. sed, are able to do this.)
Steps to Reproduce: set(FOO foo) string(REGEX REPLACE "$" "_suffix" BAR "${FOO}") (Expected result: BAR contains "foo_suffix") Additional Information: The above example is contrived for the sake of simplification. An actual use case might be replacing an existing prefix/suffix that matches a regular expression and may or may not be present. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2012-12-13 13:48 mwoehlke New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers