
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. Thanks again, -venkat -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of John Maddock Sent: Friday, August 17, 2007 11:12 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] regex_search on non-NULL terminated strings. Venkat Rangan wrote:
Hi,
Is there an option to regex_search() to limit the string it searches to a certain number of non-NULL characters? Although it is possible to make a copy and null-terminate, we would like to avoid that copy.
Yes, don't pass a single const char*, but a pair of iterators: a pair of const char*'s will do just fine if that's the data type you have to hand - the first will point to the start of the string, the second to the point where you want searching to stop. HTH, John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users