Try "g\\+\\+.*$" -- the backslashes themselves need to be escaped inside a
CMake string first... (Then the regex parser will see it as your original
"g\+\+.*$")

The error is because CMake doesn't recognize "\+" as a string escape
sequence.

On 5/11/07, James Bigler <[EMAIL PROTECTED]> wrote:

How do I match a literal '+' in a regular expression?

This matches in grep (because it doesn't treat '+' as a special
character), but CMake says it can't compile it (for good reason if '+'
is a special character).

"g++.*$"

I tried escaping the '+', but that didn't work either:

"g\+\+.*$"

syntax error, unexpected cal_ERROR, expecting $end (3), when parsing
string "g\+\+.*$"

I'm trying to match string g++, g++-4.0 etc.

Thanks,
James
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to