Hi,

I'm using cmake 2.8.3 and have a problem using regular expressions:

STRING(REGEX REPLACE
      "^(Input:[0-9]+:)([^/].*)$"
      "_Start_\\1_Middle_\\2_End_"
      TESTVARIABLE
      "Input:1:filename1 \nInput:104:filename2 \n"
      )
MESSAGE("${TESTVARIABLE}")

The expected output is:
_Start_Input:1:_Middle_filename1_End_
_Start_Input:104:_Middle_filename2_End_

However, the actual output is:
_Start_Input:1:_Middle_filename1
Input:104:filename2
_End_

It seems that . matches also the newline, altough
http://www.cmake.org/cmake/help/syntax.html
says ist shouldn't!

How can I get the expected result?

Best regards
Sven
_______________________________________________
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

Reply via email to