/[pcre]/code/trunk/doc/pcreapi.3
ViewVC logotype

Diff of /code/trunk/doc/pcreapi.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1432 by ph10, Tue Nov 19 15:36:57 2013 UTC revision 1433 by ph10, Fri Jan 3 15:15:00 2014 UTC
# Line 1  Line 1 
1  .TH PCREAPI 3 "12 November 2013" "PCRE 8.34"  .TH PCREAPI 3 "03 January 2014" "PCRE 8.35"
2  .SH NAME  .SH NAME
3  PCRE - Perl-compatible regular expressions  PCRE - Perl-compatible regular expressions
4  .sp  .sp
# Line 1248  information call is provided for interna Line 1248  information call is provided for interna
1248  function. External callers can cause PCRE to use its internal tables by passing  function. External callers can cause PCRE to use its internal tables by passing
1249  a NULL table pointer.  a NULL table pointer.
1250  .sp  .sp
1251    PCRE_INFO_FIRSTBYTE    PCRE_INFO_FIRSTBYTE (deprecated)
1252  .sp  .sp
1253  Return information about the first data unit of any matched string, for a  Return information about the first data unit of any matched string, for a
1254  non-anchored pattern. (The name of this option refers to the 8-bit library,  non-anchored pattern. The name of this option refers to the 8-bit library,
1255  where data units are bytes.) The fourth argument should point to an \fBint\fP  where data units are bytes. The fourth argument should point to an \fBint\fP
1256  variable.  variable. Negative values are used for special cases. However, this means that
1257    when the 32-bit library is in non-UTF-32 mode, the full 32-bit range of
1258    characters cannot be returned. For this reason, this value is deprecated; use
1259    PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead.
1260  .P  .P
1261  If there is a fixed first value, for example, the letter "c" from a pattern  If there is a fixed first value, for example, the letter "c" from a pattern
1262  such as (cat|cow|coyote), its value is returned. In the 8-bit library, the  such as (cat|cow|coyote), its value is returned. In the 8-bit library, the
# Line 1271  starts with "^", or Line 1274  starts with "^", or
1274  -1 is returned, indicating that the pattern matches only at the start of a  -1 is returned, indicating that the pattern matches only at the start of a
1275  subject string or after any newline within the string. Otherwise -2 is  subject string or after any newline within the string. Otherwise -2 is
1276  returned. For anchored patterns, -2 is returned.  returned. For anchored patterns, -2 is returned.
1277    .sp
1278      PCRE_INFO_FIRSTCHARACTER
1279    .sp
1280    Return the value of the first data unit (non-UTF character) of any matched
1281    string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1;
1282    otherwise return 0. The fourth argument should point to an \fBuint_t\fP
1283    variable.
1284  .P  .P
1285  Since for the 32-bit library using the non-UTF-32 mode, this function is unable  In the 8-bit library, the value is always less than 256. In the 16-bit library
1286  to return the full 32-bit range of the character, this value is deprecated;  the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value
1287  instead the PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER values  can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.
1288  should be used.  .sp
1289      PCRE_INFO_FIRSTCHARACTERFLAGS
1290    .sp
1291    Return information about the first data unit of any matched string, for a
1292    non-anchored pattern. The fourth argument should point to an \fBint\fP
1293    variable.
1294    .P
1295    If there is a fixed first value, for example, the letter "c" from a pattern
1296    such as (cat|cow|coyote), 1 is returned, and the character value can be
1297    retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and
1298    if either
1299    .sp
1300    (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch
1301    starts with "^", or
1302    .sp
1303    (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set
1304    (if it were set, the pattern would be anchored),
1305    .sp
1306    2 is returned, indicating that the pattern matches only at the start of a
1307    subject string or after any newline within the string. Otherwise 0 is
1308    returned. For anchored patterns, 0 is returned.
1309  .sp  .sp
1310    PCRE_INFO_FIRSTTABLE    PCRE_INFO_FIRSTTABLE
1311  .sp  .sp
# Line 1499  is made available via this option so tha Line 1529  is made available via this option so tha
1529  .\"  .\"
1530  documentation for details).  documentation for details).
1531  .sp  .sp
   PCRE_INFO_FIRSTCHARACTERFLAGS  
 .sp  
 Return information about the first data unit of any matched string, for a  
 non-anchored pattern. The fourth argument should point to an \fBint\fP  
 variable.  
 .P  
 If there is a fixed first value, for example, the letter "c" from a pattern  
 such as (cat|cow|coyote), 1 is returned, and the character value can be  
 retrieved using PCRE_INFO_FIRSTCHARACTER.  
 .P  
 If there is no fixed first value, and if either  
 .sp  
 (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch  
 starts with "^", or  
 .sp  
 (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set  
 (if it were set, the pattern would be anchored),  
 .sp  
 2 is returned, indicating that the pattern matches only at the start of a  
 subject string or after any newline within the string. Otherwise 0 is  
 returned. For anchored patterns, 0 is returned.  
 .sp  
   PCRE_INFO_FIRSTCHARACTER  
 .sp  
 Return the fixed first character value in the situation where  
 PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; otherwise return 0. The fourth  
 argument should point to an \fBuint_t\fP variable.  
 .P  
 In the 8-bit library, the value is always less than 256. In the 16-bit library  
 the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value  
 can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.  
 .sp  
1532    PCRE_INFO_REQUIREDCHARFLAGS    PCRE_INFO_REQUIREDCHARFLAGS
1533  .sp  .sp
1534  Returns 1 if there is a rightmost literal data unit that must exist in any  Returns 1 if there is a rightmost literal data unit that must exist in any
# Line 2900  Cambridge CB2 3QH, England. Line 2898  Cambridge CB2 3QH, England.
2898  .rs  .rs
2899  .sp  .sp
2900  .nf  .nf
2901  Last updated: 12 November 2013  Last updated: 03 January 2014
2902  Copyright (c) 1997-2013 University of Cambridge.  Copyright (c) 1997-2014 University of Cambridge.
2903  .fi  .fi

Legend:
Removed from v.1432  
changed lines
  Added in v.1433

  ViewVC Help
Powered by ViewVC 1.1.5