On Mar 30, 2013, at 11:29 PM, David Cole <[email protected]> wrote: > REGEX REPLACE will replace "this" with "that" in the entire input string, > everywhere it matches. If you want to limit it to just the one bit that > matches inside the parenthesis, you have to match the entire string, too, so > that it will also be replaced. In your example, the \\1 is being set to > "Release" and the "/build Release" is being replaced with \\1 in the entire > input string. So in effect, you erased the "/build " from in front of it. > What you want is to erase the whole string, except for the "Release", right? > > This should work: > >> string(REGEX REPLACE "^.*/build ([A-Za-z]+).*$" "\\1" BUILD_CONFIG > ${FOO}) > > I just added "^.*" at the beginning, and ".*$" at the end, so it matches the > entire input string.
Thank you... That makes sense, now that I think about it. -- Braden McDaniel [email protected] -- 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://www.cmake.org/mailman/listinfo/cmake
