The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15004 ====================================================================== Reported By: Chris Foster Assigned To: ====================================================================== Project: CMake Issue ID: 15004 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2014-07-02 21:49 EDT Last Modified: 2014-07-02 21:49 EDT ====================================================================== Summary: string(REGEX REPLACE) doesn't correctly anchor regex with ^ for multiple matches Description: string(REGEX REPLACE) doesn't seem to anchor multiple matches correctly with the ^ symbol - subsequent matches seem to be anchored at the start of the next substring.
Steps to Reproduce: Run the following cmake script: ----------- string(REGEX REPLACE "^([^-]*-)" "@\\1#" output "foo-1.2-3") message(STATUS "\"${output}\"") ----------- Output is -- "@foo-#@1.2-http://www.cmake.org/Bug/view.php?id=3" so the pattern has matched twice, whereas it should only match the input string once at the start - the expected output is -- "@foo-http://www.cmake.org/Bug/view.php?id=1.2-3" ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-07-02 21:49 Chris Foster New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers