diff options
author | Philip.Hazel <Philip.Hazel@gmail.com> | 2017-06-03 16:42:58 +0000 |
---|---|---|
committer | Philip.Hazel <Philip.Hazel@gmail.com> | 2017-06-03 16:42:58 +0000 |
commit | e4c86e2ced236b9771ea4965b7edeca086a93093 (patch) | |
tree | 748e07e2456656493ddcb098b8b852d32b081d6b /doc/pcre2posix.3 | |
parent | 8e4b992682c6dd0de8c3da2f74dc8d13c54f2441 (diff) | |
download | pcre-e4c86e2ced236b9771ea4965b7edeca086a93093.tar.gz |
Fix matching offsets from regexec() in the POSIX wrapper when called with
REG_STARTEND and a starting offset greater than zero.
Diffstat (limited to 'doc/pcre2posix.3')
-rw-r--r-- | doc/pcre2posix.3 | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/doc/pcre2posix.3 b/doc/pcre2posix.3 index 70a86d81..b37046ba 100644 --- a/doc/pcre2posix.3 +++ b/doc/pcre2posix.3 @@ -1,4 +1,4 @@ -.TH PCRE2POSIX 3 "31 January 2016" "PCRE2 10.22" +.TH PCRE2POSIX 3 "03 June 2017" "PCRE2 10.30" .SH NAME PCRE2 - Perl-compatible regular expressions (revised API) .SH "SYNOPSIS" @@ -204,15 +204,21 @@ function. .sp REG_STARTEND .sp -The string is considered to start at \fIstring\fP + \fIpmatch[0].rm_so\fP and -to have a terminating NUL located at \fIstring\fP + \fIpmatch[0].rm_eo\fP -(there need not actually be a NUL at that location), regardless of the value of -\fInmatch\fP. This is a BSD extension, compatible with but not specified by -IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software -intended to be portable to other systems. Note that a non-zero \fIrm_so\fP does -not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not -how it is matched. Setting REG_STARTEND and passing \fIpmatch\fP as NULL are -mutually exclusive; the error REG_INVARG is returned. +When this option is set, the string is considered to start at \fIstring\fP + +\fIpmatch[0].rm_so\fP and to have a terminating NUL located at \fIstring\fP + +\fIpmatch[0].rm_eo\fP (there need not actually be a NUL at that location), +regardless of the value of \fInmatch\fP. However, the offsets of the matched +string and any captured substrings are still given relative to the start of +\fIstring\fP. (Before PCRE2 release 10.30 these were given relative to +\fIstring\fP + \fIpmatch[0].rm_so\fP, but this differs from other +implementations.) +.P +This is a BSD extension, compatible with but not specified by IEEE Standard +1003.2 (POSIX.2), and should be used with caution in software intended to be +portable to other systems. Note that a non-zero \fIrm_so\fP does not imply +REG_NOTBOL; REG_STARTEND affects only the location of the string, not how it is +matched. Setting REG_STARTEND and passing \fIpmatch\fP as NULL are mutually +exclusive; the error REG_INVARG is returned. .P If the pattern was compiled with the REG_NOSUB flag, no data about any matched strings is returned. The \fInmatch\fP and \fIpmatch\fP arguments of @@ -271,6 +277,6 @@ Cambridge, England. .rs .sp .nf -Last updated: 31 January 2016 -Copyright (c) 1997-2016 University of Cambridge. +Last updated: 03 June 2017 +Copyright (c) 1997-2017 University of Cambridge. .fi |