[TRE-general] regoff_t and wide chars
Ville Laurikari
ville at laurikari.net
Sun Jan 28 20:44:31 EET 2007
On Sun, Jan 28, 2007 at 08:31:40AM -0800, Gregory Sharp wrote:
> regoff_t rm_eo
> Byte offset from start of string to the first character
> after the substring.
>
> Are the offsets really measured in bytes rather than number of
> wide characters? If so, why?
The documentation is wrong. The offsets are always given so that you
can directly use them as array offsets in the string you gave to
regexec().
I think the wording is like that to make it clear that the offsets are
byte offsets when matching with a multibyte character set (where
character offset and byte offset are not in general the same thing).
--
http://www.iki.fi/vl/
More information about the TRE-general
mailing list