[Cmake] Trouble with string match

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu, 5 Feb 2004 15:18:20 -0000


Thanks. I'm a donkey. I was using a perl regex reference doc.

JB

----- Original Message ----- 
From: "William A. Hoffman" <billlist at nycap.rr.com>
To: "John Biddiscombe" <jbiddiscombe at skippingmouse.co.uk>;
<cmake at www.cmake.org>
Sent: Thursday, February 05, 2004 1:36 PM
Subject: Re: [Cmake] Trouble with string match


> 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
>
> _______________________________________________
> Cmake mailing list
> Cmake at www.cmake.org
> http://www.cmake.org/mailman/listinfo/cmake