On 2012-10-05 13:06-0400 Brad King wrote:

The output parsing can be a bit simpler if you use the CMAKE_MATCH_1
variable result from the "if(... MATCHES ...)" command.  It is
mentioned at the bottom of the regex documentation in string():

http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:string

Hi Brad:

I was just looking over that documentation (obtained with
--help--full for CMake-2.8.9) when I spotted this
line which seemed to be problematic to me

  -        Matches any character in range on either side of a dash

I assume this is meant to refer to regex bracket expressions such as
"[0-9]".  If so, some reference to square brackets should be included
so that regex newbies don't attempt to treat the "-" character like
the "+" character which can appear outside square brackets. Here is
one alternative to the above that addresses that issue:

  -        Matches any character in range on either side of a dash
within square brackets, e.g.,
[abcx-z] matches "a", "b", "c", "x", "y", or "z", as does [a-cx-z]

(I took that example from the Wikipedia article on regular expressions).

But I am sure (from past experience) you will figure out something
shorter that still gets the idea across that - can only appear within
brackets.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to