No subject
Fri Jan 14 08:05:08 EST 2011
() Saves a matched subexpression, which can be referenced
in the REGEX REPLACE operation. Additionally it is saved
by all regular expression-related commands, including
e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).
HTH,
David
--0016369cff59adde69049a46baed
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div class=3D"gmail_quote">On Thu, Jan 20, 2011 at 7:39 AM, Michael Wild <s=
pan dir=3D"ltr"><<a href=3D"mailto:themiwi at gmail.com">themiwi at gmail.com<=
/a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left=
: 1ex;">
<div class=3D"im">On 01/20/2011 12:10 PM, SF Markus Elfring wrote:<br>
>> Thanks for your help to make CMake better,<br>
><br>
> Is the command variant "string(REGEX REPLACE ...)" completel=
y documented?<br>
><br>
> Can multiple variables be specified that will receive the data from th=
e<br>
> evaluation of subexpressions in the passed regular expression?<br>
><br>
> Regards,<br>
> Markus<br>
<br>
</div>AFAIK no, but you can "misuse" if(<string|varname> MA=
TCHES <pattern>)<br>
for this. It stores the groups in CMAKE_MATCH_<n> where <n> is =
{0..9}.<br>
Match 0 is always the whole match of <pattern> and match 1 is the<br>
contains the first group.<br>
<font color=3D"#888888"><br>
Michael<br>
</font><div><div></div><div class=3D"h5">__________________________________=
_____________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at <a href=3D"http://www.kitware.c=
om/opensource/opensource.html" target=3D"_blank">http://www.kitware.com/ope=
nsource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href=3D"http:/=
/www.cmake.org/Wiki/CMake_FAQ" target=3D"_blank">http://www.cmake.org/Wiki/=
CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.cmake.org/mailman/listinfo/cmake" target=3D"_blank">h=
ttp://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br>I think it's the case that the C=
MAKE_MATCH_* variables are set after *any* regex matching operation, be it =
from an "if(... MATCHES ...)" or a "string(REGEX" or &q=
uot;string(MATCH" command. Let us know if you find that not to be true=
.<br>
<br>From the bottom of ( <a href=3D"http://cmake.org/cmake/help/cmake-2-8-d=
ocs.html#command:string">http://cmake.org/cmake/help/cmake-2-8-docs.html#co=
mmand:string</a> ) :<br><br>=A0 () Saves a matched subexpression, which can=
be referenced <br>
=A0=A0 =A0 in the REGEX REPLACE operation. Additionally it is saved<br>=A0=
=A0 =A0 by all regular expression-related commands, including <br>=A0=A0 =
=A0 e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).<br><br><br>HTH=
,<br>David<br><br>
--0016369cff59adde69049a46baed--
More information about the CMake
mailing list