Re: [Boost-users] regex_search on non-NULL terminated strings.

The ideal interface would be: 1) terminate when NULL character is found 2) if NULL character not found, terminate when end marker is reached.
char buffer[BUFFER_SIZE]; char* buffer_begin = buffer; char* buffer_end = buffer + BUFFER_SIZE; // TODO fill buffer with string. char* string_begin = buffer; char* string_end = std::find(buffer_begin, buffer_end, 0); // TODO call regex with string_begin and string_end. // Anders Dalvander

Anders Dalvander wrote:
The ideal interface would be: 1) terminate when NULL character is found 2) if NULL character not found, terminate when end marker is reached.
char buffer[BUFFER_SIZE]; char* buffer_begin = buffer; char* buffer_end = buffer + BUFFER_SIZE; // TODO fill buffer with string. char* string_begin = buffer; char* string_end = std::find(buffer_begin, buffer_end, 0); // TODO call regex with string_begin and string_end.
Doh! Consider me suitably chastened that I didn't think of that ! :-) John.
participants (2)
-
Anders Dalvander
-
John Maddock