Name
PCRE API Synopsis
Synopsis
pcre *pcre_compile(const char *
pattern
,int
options
,const char
**
errptr
,int
*
erroffset
,const unsigned char
*
tableptr
)
Compile
pattern
with optional mode modifiersoptions
and optional locale tablestableptr
, which are created withpcre_maketables( )
. Returns either a compiled regex or NULL witherrptr
pointing to an error message anderroffset
pointing to the position inpattern
where the error occurred.int pcre_exec(const pcre *
code
,const pcre_extra
*extra
,const char
*
subject
,int
length
,int
startoffset
,int
options
,int
*
ovector
,int
ovecsize
)
Perform pattern matching with a compiled regular expression,
code
, and a supplied input string,subject
, of lengthlength
. The results of a successful match are stored inovector
. The first and second elements ofovector
contain the position of the first character in the overall match and the character following the end of the overall match. Each additional pair of elements, up to two thirds the length ofovector
, contain the positions of the starting character and the character after capture group submatches. Optional parametersoptions
contain mode modifiers, andpcre_extra
contains the results of a call topcre_study( )
.pcre_extra *pcre_study(const pcre *
code
,int
options
,const char
**
errptr
)
Return information to speed up calls to
pcre_exec( )
withcode
. There are currently no options, sooptions
should always be zero. If an error occurred,errptr
points to an error message.int pcre_copy_named_substring(const ...
Get Regular Expression Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.