cmake - error in compile regular expression
<p>I have a string: <code>1.0.2-1</code> and I need to get a substring: <code>1.0.2</code> Following regular expression works fine in c++:</p>

<pre><code>std::regex myReg(".+?(?=-)");
</code></pre>

<p>When I try to use that regex in cmake:</p>

<pre><code>STRING(REGEX MATCH ".+?(?=-)" OUTPUT $VER)
</code></pre>

<p>I get errors:</p>

<pre><code>[INFO] RegularExpression::compile(): Nested *?+.
[INFO] RegularExpression::compile(): Error in compile.
</code></pre>

<p>How to fix that ?</p>