[CMake] Fw: STRING - REGEX REPLACE use
Andy Cedilnik
andy.cedilnik at kitware.com
Wed Dec 8 07:54:32 EST 2004
Hi Benoit,
>From cmake --help-command STRING:
cmake version 2.1-20041117
STRING
String operations.
STRING(REGEX MATCH <regular_expression>
<output variable> <input> [<input>...])
STRING(REGEX MATCHALL <regular_expression>
<output variable> <input> [<input>...])
STRING(REGEX REPLACE <regular_expression>
<replace_expression> <output variable>
<input> [<input>...])
...
So,
STRING(
#1 REGEX
#2 REPLACE
#3 "foo"
#4 "bar"
#5 variable
#6 input_string
[#7 another_input_string]
[...]
)
Andy
Benoit Regrain wrote:
>Hi,
>Thanks Troels,
>
>But CMake say me that it needs 6 arguments for STRING(REGEX REPLACE
>What must be this the 6th parameter ?
>
>My CMake version is : CMAKE 2.0 patch 5
>Benoit
>
>----- Original Message -----
>From: "Troels Frimor" <troels at in.tum.de>
>To: "Benoit Regrain" <benoit.regrain at creatis.insa-lyon.fr>
>Cc: <cmake at www.cmake.org>
>Sent: Wednesday, December 08, 2004 11:04 AM
>Subject: Re: [CMake] Fw: STRING - REGEX REPLACE use
>
>
>
>
>>Hi,
>>
>>I would expect you could do something like:
>>STRING(REGEX REPLACE
>>"(.*)FileSeq0(.*)"
>>"\\1FileSeq%d\\2"
>>Var_out
>>${var_in})
>>
>>Where the first 2 middle parameters is the replacement regular
>>expressions, and the second to last is where it gets stored, and last is
>>the variable with your input, in this case:
>>"SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm"
>>
>>regards,
>>Troels
>>
>>Benoit Regrain wrote:
>>
>>
>>>Hi,
>>>
>>>Anyone could explain me how to use the STRING command with the
>>>REGEX REPLACE parameter
>>>
>>>CMake request me 6 parameters but I don't understand want I must set.
>>>
>>>What I want exactly to do :
>>>I have a file like SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm
>>>And I would have SIEMENS_MAGNETOM-12-MONO2-FileSeq%d.dcm
>>>The idea might be to replace the 'FileSeq0' by FileSeq%d'
>>>
>>>Cheers
>>>
>>>-----------------------------------------------------------------
>>>Benoit Regrain
>>>Ingénieur d'études CNRS (Creatis)
>>>email : regrain at creatis.insa-lyon.fr
>>>
>>>
><mailto:regrain at creatis.insa-lyon.fr>
>
>
>>>phone : (+33) (0) 4.72.43.82.58
>>>fax : (+33) (0) 4.72.43.85.26
>>>INSA - Bâtiment Blaise Pascal
>>>7, avenue Jean Capelle
>>>F - 69621 Villeurbanne Cedex
>>>-----------------------------------------------------------------
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>CMake mailing list
>>>CMake at www.cmake.org
>>>http://www.cmake.org/mailman/listinfo/cmake
>>>
>>>
>
>_______________________________________________
>CMake mailing list
>CMake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>
>
--
Andy Cedilnik
Kitware Inc.
More information about the CMake
mailing list