[[Partial match][True][False][Start of partial match.][End of partial match (end of text).]]
[[Full match][True][True][Start of full match.][End of full match.]]
]
Be aware that using partial matches can sometimes result in somewhat
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.
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
would be added to the string being built up, and passed to `is_possible_card_number`.
If this returns true then the text could be a valid card number, so the
user interface's OK button would be enabled. If it returns false, then
this is not yet a valid card number, but could be with more input, so
the user interface would disable the OK button. Finally, if the procedure
throws an exception the input could never become a valid number, and the
inputted character must be discarded, and a suitable error indication