[CMake] Usage of regular expressions: how to specify ] in [ ] list?

Dmitry Kuzmenko dmitry.a.kuzmenko at gmail.com
Mon Oct 11 03:14:22 EDT 2010


Hello, everybody!

I've just tried to compile regular expression matches any string, ends with 
set of symbols, including right square bracket. How can I do that?

If I specify ".*[\]})]" cmake prints error:
Syntax error in cmake code at /home/dimm/test/test.cmake:3 when parsing string 
.*[\]})] Invalid escape sequence \]

If I use ".*[\\]})]" it thinks I want to match a string ends with "\})]" 
sequence.

What is the proper way to do something like this?

Dmitry.


More information about the CMake mailing list