mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 13:52:17 +02:00
Allow match_results::position() to return a valid value for partial matches.
[SVN r34324]
This commit is contained in:
@ -27,8 +27,11 @@
|
||||
<P>Boost 1.34</P>
|
||||
<UL>
|
||||
<LI>
|
||||
Fix for non-greedy repeats and partial matches not working correctly in some cases.
|
||||
</LI>
|
||||
Fix for non-greedy repeats and partial matches not working correctly in some
|
||||
cases.
|
||||
<LI>
|
||||
Changed match_results::position() to return a valid result when *this
|
||||
represents a partial match.</LI>
|
||||
</UL>
|
||||
<P>Boost 1.33.1</P>
|
||||
<UL>
|
||||
@ -169,4 +172,3 @@
|
||||
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -300,7 +300,9 @@ difference_type position(unsigned int sub = 0)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Returns the starting location of sub-expression <EM>sub</EM>,
|
||||
or -1 if <EM>sub</EM> was not matched <code>.</code></p>
|
||||
or -1 if <EM>sub</EM> was not matched. Note that if this represents a <A href="partial_matches.html">
|
||||
partial match</A> , then <code>position()</code> will return the location of
|
||||
the partial match even though <code>(*this)[0].matched</code> is <EM>false</EM>.</p>
|
||||
<pre><A name=m6></A>
|
||||
string_type str(int sub = 0)const;
|
||||
</pre>
|
||||
|
@ -27,8 +27,11 @@
|
||||
<P>Boost 1.34</P>
|
||||
<UL>
|
||||
<LI>
|
||||
Fix for non-greedy repeats and partial matches not working correctly in some cases.
|
||||
</LI>
|
||||
Fix for non-greedy repeats and partial matches not working correctly in some
|
||||
cases.
|
||||
<LI>
|
||||
Changed match_results::position() to return a valid result when *this
|
||||
represents a partial match.</LI>
|
||||
</UL>
|
||||
<P>Boost 1.33.1</P>
|
||||
<UL>
|
||||
@ -169,4 +172,3 @@
|
||||
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -300,7 +300,9 @@ difference_type position(unsigned int sub = 0)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Returns the starting location of sub-expression <EM>sub</EM>,
|
||||
or -1 if <EM>sub</EM> was not matched <code>.</code></p>
|
||||
or -1 if <EM>sub</EM> was not matched. Note that if this represents a <A href="partial_matches.html">
|
||||
partial match</A> , then <code>position()</code> will return the location of
|
||||
the partial match even though <code>(*this)[0].matched</code> is <EM>false</EM>.</p>
|
||||
<pre><A name=m6></A>
|
||||
string_type str(int sub = 0)const;
|
||||
</pre>
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
if(sub < m_subs.size())
|
||||
{
|
||||
const sub_match<BidiIterator>& s = m_subs[sub];
|
||||
if(s.matched)
|
||||
if(s.matched || (sub == 2))
|
||||
{
|
||||
return ::boost::re_detail::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
|
||||
}
|
||||
|
Reference in New Issue
Block a user