#609991 regexec(3): silent about pmatch[0] and fails to refer to manpages-posix-dev

#609991#5
Date:
2011-01-14 17:36:40 UTC
From:
To:
regexec description in manpages-dev is fairly misleading on the contents
of pmatch elements (and particularly pmatch[0]) after a successful match:
"Each rm_so element that is not -1 indicates the start offset of the next
largest substring match within the string."

The real situation is much better described in manpages-posix-dev, to which
sadly there is no "SEE ALSO" reference:
"... pmatch[i].rm_so shall be the byte offset of the beginning
and pmatch[i].rm_eo shall be one greater than the byte offset of the
end of substring i. (Subexpression i begins at the ith matched open
parenthesis, counting from 1.) Offsets in pmatch[0] identify the
substring that corresponds to the entire regular  expression."