This commit is contained in:
jzmaddock
2016-03-12 19:01:17 +00:00
parent e217808156
commit d1e65490e0
3 changed files with 15 additions and 1 deletions

View File

@ -178,6 +178,17 @@
It's more efficient to work this way, but may not be the behavior you want
in all situations.
</li>
<li class="listitem">
There are situations where full matches are found even though partial matches
are also possible: for example if the partial string terminates with "abc"
and the regular expression is "\w+", then a full match is found
even though there may be more alphabetical characters to come. This particular
case can be detected by checking if the match found terminates at the end
of current input string. However, there are situations where that is not
possible: for example an expression such as "abc.*123" may always
have longer matches available since it could conceivably match the entire
input string (no matter how long it may be).
</li>
</ul></div>
<p>
The following example tests to see whether the text could be a valid credit

View File

@ -221,7 +221,7 @@
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: January 10, 2016 at 18:43:41 GMT</small></p></td>
<td align="left"><p><small>Last revised: March 12, 2016 at 19:00:00 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -34,6 +34,9 @@ imperfect behavior:
* There are some expressions, such as ".\*abc" that will always produce a partial match. This problem can be reduced by careful construction of the regular expressions used, or by setting flags like match_not_dot_newline so that expressions like .\* can't match past line boundaries.
* Boost.Regex currently prefers leftmost matches to full matches, so for example matching "abc|b" against "ab" produces a partial match against the "ab" rather than a full match against "b". It's more efficient to work this way, but may not be the behavior you want in all situations.
* There are situations where full matches are found even though partial matches are also possible: for example if the partial string terminates with "abc" and the regular expression is "\w+", then a full match is found
even though there may be more alphabetical characters to come. This particular case can be detected by checking if the match found terminates at the end of current input string. However, there are situations where
that is not possible: for example an expression such as "abc.*123" may always have longer matches available since it could conceivably match the entire input string (no matter how long it may be).
The following example tests to see whether the text could be a valid
credit card number, as the user presses a key, the character entered