
17 Aug
2007
17 Aug
'07
6:11 p.m.
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.