[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] =?windows-1252?q?string=28REGEX_REPLACE_=85=29_syntax_pro?= =?windows-1252?q?blem?=
From:       Braden McDaniel <braden () endoframe ! com>
Date:       2013-03-31 3:09:52
Message-ID: AD5D7B16-A131-4B88-88EF-556E16D50B99 () endoframe ! com
[Download RAW message or body]

I must be Doing It Wrong; but I'm not seeing how...

If I do a REGEX MATCH as follows:

> build_command(FOO)
> string(REGEX MATCH "/build ([A-Za-z]+)" BUILD_CONFIG ${FOO})
> message(STATUS "BUILD_CONFIG = ${BUILD_CONFIG}")


... I get, as expected:

> BUILD_CONFIG = /build Release

However, if I use the same expression with REGEX REPLACE:

> build_command(FOO)
> string(REGEX REPLACE "/build ([A-Za-z]+)" "\\1" BUILD_CONFIG ${FOO})
> message(STATUS "BUILD_CONFIG = ${BUILD_CONFIG}")

... BUILD_CONFIG holds the entire build command line rather than just the configuration name:

> BUILD_CONFIG = C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com my.sln Release /project ALL_BUILD


How am I misapplying REGEX REPLACE?

-- 
Braden McDaniel
braden@endoframe.com

--

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic