Boost logo

Boost Users :

From: Venkat Rangan (venkat.rangan_at_[hidden])
Date: 2007-08-17 14:53:49


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_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of John Maddock
Sent: Friday, August 17, 2007 11:12 AM
To: boost-users_at_[hidden]
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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net