
John, Thanks for following up. We know the size of the buffer we allocated. A workaround is to insert a NULL character at the end of the buffer, but given that these messages are created elsewhere in other components and are delivered to our search module, we do not have an opportunity to insert NULL character, forcing a copy to separate buffer under our control. The ideal interface would be: 1) terminate when NULL character is found 2) if NULL character not found, terminate when end marker is reached. -venkat -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of John Maddock Sent: Saturday, August 18, 2007 2:12 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] regex_search on non-NULL terminated strings. Venkat Rangan wrote:
John,
Thanks very much - this is almost what we want. We did notice that if there is a null before the end, the search does not stop. Any way to overcome that? We wouldn't mind doing a strlen(), but that is prone to failure, so something like strlen_s() or a safe strlen would help. But strlen_s() is not available in Microsoft MSDN 7.1.
Ah, so you want the search to terminate if *either*: * There is a NULL character * We hit a certain length Is that right? I must admit to being a tad confused here: how do you know how long the string is (when it's created for example?) Surely you must have a length stored somewhere? John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users