[Cmake] Trouble with string match

William A. Hoffman billlist at nycap.rr.com
Thu, 05 Feb 2004 08:36:08 -0500


CMake does not have the same regular expression parser as perl or tcl, and
\d is not supported.  There is documentation for the regular expression
can be found here:

http://public.kitware.com/cgi-bin/cvsweb.cgi/CMake/Source/kwsys/RegularExpression.hxx.in?rev=1.7&content-type=text/x-cvsweb-markup&cvsroot=CMake

I think what you want is [0-9], I assume \d is supposed to be a short hand
for decimal numbers.

-Bill

At 06:23 AM 2/5/2004, John Biddiscombe wrote:
>Hi all,
>
>I'm passing a number into a macro and do this
>IF("${VERSION}" MATCHES "\\d")
>do something,
>
>but if the version is actaully not numeric (ie a tag name from CVS), I want
>to do something else. The string match "regex" doesn't seem to work
>
>if I do
>
>
>IF("${VERSION}" MATCHES "1")
>it passes
>but
>IF("${VERSION}" MATCHES \\d)
>with the string "1" passed in, it fails.
>
>Any ideas?
>
>thanks
>
>JB
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake