version 1.1, 2012/02/21 23:50:25
|
version 1.1.1.4, 2014/06/15 19:46:05
|
Line 1
|
Line 1
|
.TH PCRE 3 | .TH PCRE 3 "12 May 2013" "PCRE 8.33" |
.SH NAME |
.SH NAME |
PCRE - Perl-compatible regular expressions |
PCRE - Perl-compatible regular expressions |
.sp |
.sp |
Line 8 PCRE - Perl-compatible regular expressions
|
Line 8 PCRE - Perl-compatible regular expressions
|
.SH "PCRE 16-BIT API BASIC FUNCTIONS" |
.SH "PCRE 16-BIT API BASIC FUNCTIONS" |
.rs |
.rs |
.sp |
.sp |
.SM | .nf |
.B pcre16 *pcre16_compile(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, |
.B pcre16 *pcre16_compile(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, |
.ti +5n | .B " const char **\fIerrptr\fP, int *\fIerroffset\fP," |
.B const char **\fIerrptr\fP, int *\fIerroffset\fP, | .B " const unsigned char *\fItableptr\fP);" |
.ti +5n | .sp |
.B const unsigned char *\fItableptr\fP); | |
.PP | |
.B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, |
.B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, |
.ti +5n | .B " int *\fIerrorcodeptr\fP," |
.B int *\fIerrorcodeptr\fP, | .B " const char **\fIerrptr\fP, int *\fIerroffset\fP," |
.ti +5n | .B " const unsigned char *\fItableptr\fP);" |
.B const char **\fIerrptr\fP, int *\fIerroffset\fP, | .sp |
.ti +5n | |
.B const unsigned char *\fItableptr\fP); | |
.PP | |
.B pcre16_extra *pcre16_study(const pcre16 *\fIcode\fP, int \fIoptions\fP, |
.B pcre16_extra *pcre16_study(const pcre16 *\fIcode\fP, int \fIoptions\fP, |
.ti +5n | .B " const char **\fIerrptr\fP);" |
.B const char **\fIerrptr\fP); | .B void pcre16_free_study(pcre16_extra *\fIextra\fP); |
.PP | |
.B void pcre16_free_study(pcre16_extra *\fIextra\fP); |
.B void pcre16_free_study(pcre16_extra *\fIextra\fP); |
.PP | .sp |
.B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.ti +5n | .B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," |
.B "PCRE_SPTR16 \fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, | .B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" |
.ti +5n | .sp |
.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP); | |
.PP | |
.B int pcre16_dfa_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.B int pcre16_dfa_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.ti +5n | .B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," |
.B "PCRE_SPTR16 \fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, | .B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," |
.ti +5n | .B " int *\fIworkspace\fP, int \fIwscount\fP);" |
.B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP, | .fi |
.ti +5n | |
.B int *\fIworkspace\fP, int \fIwscount\fP); | |
. |
. |
. |
. |
.SH "PCRE 16-BIT API STRING EXTRACTION FUNCTIONS" |
.SH "PCRE 16-BIT API STRING EXTRACTION FUNCTIONS" |
.rs |
.rs |
.sp |
.sp |
|
.nf |
.B int pcre16_copy_named_substring(const pcre16 *\fIcode\fP, |
.B int pcre16_copy_named_substring(const pcre16 *\fIcode\fP, |
.ti +5n | .B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," |
.B PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, | .B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," |
.ti +5n | .B " PCRE_UCHAR16 *\fIbuffer\fP, int \fIbuffersize\fP);" |
.B int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP, | .sp |
.ti +5n | |
.B PCRE_UCHAR16 *\fIbuffer\fP, int \fIbuffersize\fP); | |
.PP | |
.B int pcre16_copy_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, |
.B int pcre16_copy_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, |
.ti +5n | .B " int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR16 *\fIbuffer\fP," |
.B int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR16 *\fIbuffer\fP, | .B " int \fIbuffersize\fP);" |
.ti +5n | .sp |
.B int \fIbuffersize\fP); | |
.PP | |
.B int pcre16_get_named_substring(const pcre16 *\fIcode\fP, |
.B int pcre16_get_named_substring(const pcre16 *\fIcode\fP, |
.ti +5n | .B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," |
.B PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, | .B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," |
.ti +5n | .B " PCRE_SPTR16 *\fIstringptr\fP);" |
.B int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP, | .sp |
.ti +5n | |
.B PCRE_SPTR16 *\fIstringptr\fP); | |
.PP | |
.B int pcre16_get_stringnumber(const pcre16 *\fIcode\fP, |
.B int pcre16_get_stringnumber(const pcre16 *\fIcode\fP, |
.ti +5n | .B " PCRE_SPTR16 \fIname\fP); |
.B PCRE_SPTR16 \fIname\fP); | .B int pcre16_get_stringtable_entries(const pcre16 *\fIcode\fP, |
.PP | |
.B int pcre16_get_stringtable_entries(const pcre16 *\fIcode\fP, |
.B int pcre16_get_stringtable_entries(const pcre16 *\fIcode\fP, |
.ti +5n | .B " PCRE_SPTR16 \fIname\fP, PCRE_UCHAR16 **\fIfirst\fP, PCRE_UCHAR16 **\fIlast\fP);" |
.B PCRE_SPTR16 \fIname\fP, PCRE_UCHAR16 **\fIfirst\fP, PCRE_UCHAR16 **\fIlast\fP); | .B int pcre16_get_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, |
.PP | |
.B int pcre16_get_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, |
.B int pcre16_get_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, |
.ti +5n | .B " int \fIstringcount\fP, int \fIstringnumber\fP," |
.B int \fIstringcount\fP, int \fIstringnumber\fP, | .B " PCRE_SPTR16 *\fIstringptr\fP);" |
.ti +5n | .sp |
.B PCRE_SPTR16 *\fIstringptr\fP); | |
.PP | |
.B int pcre16_get_substring_list(PCRE_SPTR16 \fIsubject\fP, |
.B int pcre16_get_substring_list(PCRE_SPTR16 \fIsubject\fP, |
.ti +5n | .B " int *\fIovector\fP, int \fIstringcount\fP, PCRE_SPTR16 **\fIlistptr\fP);" |
.B int *\fIovector\fP, int \fIstringcount\fP, "PCRE_SPTR16 **\fIlistptr\fP);" | .B void pcre16_free_substring(PCRE_SPTR16 \fIstringptr\fP); |
.PP | |
.B void pcre16_free_substring(PCRE_SPTR16 \fIstringptr\fP); |
.B void pcre16_free_substring(PCRE_SPTR16 \fIstringptr\fP); |
.PP | .sp |
.B void pcre16_free_substring_list(PCRE_SPTR16 *\fIstringptr\fP); |
.B void pcre16_free_substring_list(PCRE_SPTR16 *\fIstringptr\fP); |
|
.fi |
. |
. |
. |
. |
.SH "PCRE 16-BIT API AUXILIARY FUNCTIONS" |
.SH "PCRE 16-BIT API AUXILIARY FUNCTIONS" |
.rs |
.rs |
.sp |
.sp |
|
.nf |
.B pcre16_jit_stack *pcre16_jit_stack_alloc(int \fIstartsize\fP, int \fImaxsize\fP); |
.B pcre16_jit_stack *pcre16_jit_stack_alloc(int \fIstartsize\fP, int \fImaxsize\fP); |
.PP | .sp |
.B void pcre16_jit_stack_free(pcre16_jit_stack *\fIstack\fP); |
.B void pcre16_jit_stack_free(pcre16_jit_stack *\fIstack\fP); |
.PP | .sp |
.B void pcre16_assign_jit_stack(pcre16_extra *\fIextra\fP, |
.B void pcre16_assign_jit_stack(pcre16_extra *\fIextra\fP, |
.ti +5n | .B " pcre16_jit_callback \fIcallback\fP, void *\fIdata\fP);" |
.B pcre16_jit_callback \fIcallback\fP, void *\fIdata\fP); | .B const unsigned char *pcre16_maketables(void); |
.PP | |
.B const unsigned char *pcre16_maketables(void); |
.B const unsigned char *pcre16_maketables(void); |
.PP | .sp |
.B int pcre16_fullinfo(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.B int pcre16_fullinfo(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," |
.ti +5n | .B " int \fIwhat\fP, void *\fIwhere\fP);" |
.B int \fIwhat\fP, void *\fIwhere\fP); | .B int pcre16_refcount(pcre16 *\fIcode\fP, int \fIadjust\fP); |
.PP | |
.B int pcre16_refcount(pcre16 *\fIcode\fP, int \fIadjust\fP); |
.B int pcre16_refcount(pcre16 *\fIcode\fP, int \fIadjust\fP); |
.PP | .sp |
.B int pcre16_config(int \fIwhat\fP, void *\fIwhere\fP); |
.B int pcre16_config(int \fIwhat\fP, void *\fIwhere\fP); |
.PP | .sp |
.B const char *pcre16_version(void); |
.B const char *pcre16_version(void); |
.PP | .sp |
.B int pcre16_pattern_to_host_byte_order(pcre16 *\fIcode\fP, |
.B int pcre16_pattern_to_host_byte_order(pcre16 *\fIcode\fP, |
.ti +5n | .B " pcre16_extra *\fIextra\fP, const unsigned char *\fItables\fP);" |
.B pcre16_extra *\fIextra\fP, const unsigned char *\fItables\fP); | . |
. |
. |
. |
. |
.SH "PCRE 16-BIT API INDIRECTED FUNCTIONS" |
.SH "PCRE 16-BIT API INDIRECTED FUNCTIONS" |
.rs |
.rs |
.sp |
.sp |
|
.nf |
.B void *(*pcre16_malloc)(size_t); |
.B void *(*pcre16_malloc)(size_t); |
.PP | .sp |
.B void (*pcre16_free)(void *); |
.B void (*pcre16_free)(void *); |
.PP | .sp |
.B void *(*pcre16_stack_malloc)(size_t); |
.B void *(*pcre16_stack_malloc)(size_t); |
.PP | .sp |
.B void (*pcre16_stack_free)(void *); |
.B void (*pcre16_stack_free)(void *); |
.PP | .sp |
.B int (*pcre16_callout)(pcre16_callout_block *); |
.B int (*pcre16_callout)(pcre16_callout_block *); |
|
.fi |
. |
. |
. |
. |
.SH "PCRE 16-BIT API 16-BIT-ONLY FUNCTION" |
.SH "PCRE 16-BIT API 16-BIT-ONLY FUNCTION" |
.rs |
.rs |
.sp |
.sp |
|
.nf |
.B int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *\fIoutput\fP, |
.B int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *\fIoutput\fP, |
.ti +5n | .B " PCRE_SPTR16 \fIinput\fP, int \fIlength\fP, int *\fIbyte_order\fP," |
.B PCRE_SPTR16 \fIinput\fP, int \fIlength\fP, int *\fIbyte_order\fP, | .B " int \fIkeep_boms\fP);" |
.ti +5n | .fi |
.B int \fIkeep_boms\fP); | |
. |
. |
. |
. |
.SH "THE PCRE 16-BIT LIBRARY" |
.SH "THE PCRE 16-BIT LIBRARY" |
Line 170 library. For example, if you want to study a pattern t
|
Line 150 library. For example, if you want to study a pattern t
|
.rs |
.rs |
.sp |
.sp |
There is only one header file, \fBpcre.h\fP. It contains prototypes for all the |
There is only one header file, \fBpcre.h\fP. It contains prototypes for all the |
functions in both libraries, as well as definitions of flags, structures, error | functions in all libraries, as well as definitions of flags, structures, error |
codes, etc. |
codes, etc. |
. |
. |
. |
. |
Line 190 of bytes with the C type "char *". In the 16-bit libra
|
Line 170 of bytes with the C type "char *". In the 16-bit libra
|
vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an |
vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an |
appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In |
appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In |
very many environments, "short int" is a 16-bit data type. When PCRE is built, |
very many environments, "short int" is a 16-bit data type. When PCRE is built, |
it defines PCRE_UCHAR16 as "short int", but checks that it really is a 16-bit | it defines PCRE_UCHAR16 as "unsigned short int", but checks that it really is a |
data type. If it is not, the build fails with an error message telling the | 16-bit data type. If it is not, the build fails with an error message telling |
maintainer to modify the definition appropriately. | the maintainer to modify the definition appropriately. |
. |
. |
. |
. |
.SH "STRUCTURE TYPES" |
.SH "STRUCTURE TYPES" |
Line 246 buffer, including the zero terminator if the string wa
|
Line 226 buffer, including the zero terminator if the string wa
|
.SH "SUBJECT STRING OFFSETS" |
.SH "SUBJECT STRING OFFSETS" |
.rs |
.rs |
.sp |
.sp |
The offsets within subject strings that are returned by the matching functions | The lengths and starting offsets of subject strings must be specified in 16-bit |
are in 16-bit units rather than bytes. | data units, and the offsets within subject strings that are returned by the |
| matching functions are in also 16-bit units rather than bytes. |
. |
. |
. |
. |
.SH "NAMED SUBPATTERNS" |
.SH "NAMED SUBPATTERNS" |
Line 264 units.
|
Line 245 units.
|
.sp |
.sp |
There are two new general option names, PCRE_UTF16 and PCRE_NO_UTF16_CHECK, |
There are two new general option names, PCRE_UTF16 and PCRE_NO_UTF16_CHECK, |
which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In |
which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In |
fact, these new options define the same bits in the options word. | fact, these new options define the same bits in the options word. There is a |
| discussion about the |
| .\" HTML <a href="pcreunicode.html#utf16strings"> |
| .\" </a> |
| validity of UTF-16 strings |
| .\" |
| in the |
| .\" HREF |
| \fBpcreunicode\fP |
| .\" |
| page. |
.P |
.P |
For the \fBpcre16_config()\fP function there is an option PCRE_CONFIG_UTF16 |
For the \fBpcre16_config()\fP function there is an option PCRE_CONFIG_UTF16 |
that returns 1 if UTF-16 support is configured, otherwise 0. If this option is |
that returns 1 if UTF-16 support is configured, otherwise 0. If this option is |
given to \fBpcre_config()\fP, or if the PCRE_CONFIG_UTF8 option is given to | given to \fBpcre_config()\fP or \fBpcre32_config()\fP, or if the |
\fBpcre16_config()\fP, the result is the PCRE_ERROR_BADOPTION error. | PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 option is given to \fBpcre16_config()\fP, |
| the result is the PCRE_ERROR_BADOPTION error. |
. |
. |
. |
. |
.SH "CHARACTER CODES" |
.SH "CHARACTER CODES" |
Line 318 page. The UTF-16 errors are:
|
Line 310 page. The UTF-16 errors are:
|
PCRE_UTF16_ERR1 Missing low surrogate at end of string |
PCRE_UTF16_ERR1 Missing low surrogate at end of string |
PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate |
PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate |
PCRE_UTF16_ERR3 Isolated low surrogate |
PCRE_UTF16_ERR3 Isolated low surrogate |
PCRE_UTF16_ERR4 Invalid character 0xfffe | PCRE_UTF16_ERR4 Non-character |
. |
. |
. |
. |
.SH "ERROR TEXTS" |
.SH "ERROR TEXTS" |
Line 344 files, but it can be used for testing the 16-bit libra
|
Line 336 files, but it can be used for testing the 16-bit libra
|
command line option \fB-16\fP, patterns and subject strings are converted from |
command line option \fB-16\fP, patterns and subject strings are converted from |
8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions |
8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions |
are used instead of the 8-bit ones. Returned 16-bit strings are converted to |
are used instead of the 8-bit ones. Returned 16-bit strings are converted to |
8-bit for output. If the 8-bit library was not compiled, \fBpcretest\fP | 8-bit for output. If both the 8-bit and the 32-bit libraries were not compiled, |
defaults to 16-bit and the \fB-16\fP option is ignored. | \fBpcretest\fP defaults to 16-bit and the \fB-16\fP option is ignored. |
.P |
.P |
When PCRE is being built, the \fBRunTest\fP script that is called by "make |
When PCRE is being built, the \fBRunTest\fP script that is called by "make |
check" uses the \fBpcretest\fP \fB-C\fP option to discover which of the 8-bit | check" uses the \fBpcretest\fP \fB-C\fP option to discover which of the 8-bit, |
and 16-bit libraries has been built, and runs the tests appropriately. | 16-bit and 32-bit libraries has been built, and runs the tests appropriately. |
. |
. |
. |
. |
.SH "NOT SUPPORTED IN 16-BIT MODE" |
.SH "NOT SUPPORTED IN 16-BIT MODE" |
Line 374 Cambridge CB2 3QH, England.
|
Line 366 Cambridge CB2 3QH, England.
|
.rs |
.rs |
.sp |
.sp |
.nf |
.nf |
Last updated: 08 January 2012 | Last updated: 12 May 2013 |
Copyright (c) 1997-2012 University of Cambridge. | Copyright (c) 1997-2013 University of Cambridge. |
.fi |
.fi |