boost::regexp unexpected behaviour
<p>I have this regular expression:</p>

<pre><code>(?:^|\\n)[ \\t]*(-(.|\\n)*?)(?=\\n[ \\t]*-|$)
</code></pre>

<p>I want to use it with this text</p>

<pre><code> -h --help                 Show this screen.
 --version                 Show version.
 --prefix=&lt;path&gt;           Set the specified path as the prefix
                           for paths mentioned below (except ones
                           specified manually).
 -c, --config=&lt;cfg-file&gt;   Configuration file name
                           [default: &lt;prefix&gt;/etc/myprog/protocols.conf].
 --script=&lt;asl-file&gt;       Input script file which will be played.
                           If not specified then contents of the
                           &lt;prefix&gt;/etc/myprog/script.active will be taken.
</code></pre>

<p>to find out each option with its description. With <code>&lt;regex&gt;</code> from GCC 5.3 this expression works as expected, but if I include the <code>&lt;boost/regex.hpp&gt;</code> (the last version at this moment) it matches</p>

<pre><code> --prefix=&lt;path&gt;           Set the specified path as the prefix
</code></pre>

<p>but not</p>

<pre><code> --prefix=&lt;path&gt;           Set the specified path as the prefix
                           for paths mentioned below (except ones
                           specified manually).
</code></pre>

<p>Have anybody any ideas?</p>

<p>ADD:</p>

<p>I tested this regexp at <a href="http://www.regextester.com/" rel="nofollow">http://www.regextester.com/</a> -- it behaved as expected too.</p>

<p>ADD:</p>

<p>I built a shared library using boost's regexp sources without any changes in them; I done this with this lines in makefile:</p>

<pre><code>g++ -std=c++0x -I../../include -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$&lt;"
</code></pre>

<p>and</p>

<pre><code>g++ -Wl,--no-undefined -shared -o "libregex.so" $(OBJS) $(USER_OBJS) $(LIBS)
</code></pre>

<p>Maybe I need to adjust the Unicode options of the boost::regex?..</p>