PCRE_EXEC(3) Library Functions Manual PCRE_EXEC(3) NNAAMMEE PCRE - Perl-compatible regular expressions SSYYNNOOPPSSIISS ##iinncclluuddee <
> iinntt ppccrree__eexxeecc((ccoonnsstt ppccrree **_c_o_d_e,, ccoonnsstt ppccrree__eexxttrraa **_e_x_t_r_a,, ccoonnsstt cchhaarr **_s_u_b_j_e_c_t,, iinntt _l_e_n_g_t_h,, iinntt _s_t_a_r_t_o_f_f_s_e_t,, iinntt _o_p_t_i_o_n_s,, iinntt **_o_v_e_c_t_o_r,, iinntt _o_v_e_c_s_i_z_e));; iinntt ppccrree1166__eexxeecc((ccoonnsstt ppccrree1166 **_c_o_d_e,, ccoonnsstt ppccrree1166__eexxttrraa **_e_x_t_r_a,, PPCCRREE__SSPPTTRR1166 _s_u_b_j_e_c_t,, iinntt _l_e_n_g_t_h,, iinntt _s_t_a_r_t_o_f_f_s_e_t,, iinntt _o_p_t_i_o_n_s,, iinntt **_o_v_e_c_t_o_r,, iinntt _o_v_e_c_s_i_z_e));; iinntt ppccrree3322__eexxeecc((ccoonnsstt ppccrree3322 **_c_o_d_e,, ccoonnsstt ppccrree3322__eexxttrraa **_e_x_t_r_a,, PPCCRREE__SSPPTTRR3322 _s_u_b_j_e_c_t,, iinntt _l_e_n_g_t_h,, iinntt _s_t_a_r_t_o_f_f_s_e_t,, iinntt _o_p_t_i_o_n_s,, iinntt **_o_v_e_c_t_o_r,, iinntt _o_v_e_c_s_i_z_e));; DDEESSCCRRIIPPTTIIOONN This function matches a compiled regular expression against a given subject string, using a matching algorithm that is similar to Perl's. It returns offsets to captured substrings. Its arguments are: _c_o_d_e Points to the compiled pattern _e_x_t_r_a Points to an associated ppccrree[[1166||3322]]__eexxttrraa structure, or is NULL _s_u_b_j_e_c_t Points to the subject string _l_e_n_g_t_h Length of the subject string _s_t_a_r_t_o_f_f_s_e_t Offset in the subject at which to start matching _o_p_t_i_o_n_s Option bits _o_v_e_c_t_o_r Points to a vector of ints for result offsets _o_v_e_c_s_i_z_e Number of elements in the vector (a multiple of 3) The units for _l_e_n_g_t_h and _s_t_a_r_t_o_f_f_s_e_t are bytes for ppccrree__eexxeecc(()), 16-bit data items for ppccrree1166__eexxeecc(()), and 32-bit items for ppccrree3322__eexxeecc(()). The options are: PCRE_ANCHORED Match only at the first position PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF PCRE_BSR_UNICODE \R matches all Unicode line endings PCRE_NEWLINE_ANY Recognize any Unicode newline sequence PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences PCRE_NEWLINE_CR Recognize CR as the only newline sequence PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence PCRE_NEWLINE_LF Recognize LF as the only newline sequence PCRE_NOTBOL Subject string is not the beginning of a line PCRE_NOTEOL Subject string is not the end of a line PCRE_NOTEMPTY An empty string is not a valid match PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject is not a valid match PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16 validity (only relevant if PCRE_UTF16 was set at compile time) PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32 validity (only relevant if PCRE_UTF32 was set at compile time) PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 validity (only relevant if PCRE_UTF8 was set at compile time) PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial PCRE_PARTIAL_SOFT ) match if no full matches are found PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match if that is found before a full match For details of partial matching, see the ppccrreeppaarrttiiaall page. A ppccrree__eexxttrraa structure contains the following fields: _f_l_a_g_s Bits indicating which fields are set _s_t_u_d_y___d_a_t_a Opaque data from ppccrree[[1166||3322]]__ssttuuddyy(()) _m_a_t_c_h___l_i_m_i_t Limit on internal resource use _m_a_t_c_h___l_i_m_i_t___r_e_c_u_r_s_i_o_n Limit on internal recursion depth _c_a_l_l_o_u_t___d_a_t_a Opaque data passed back to callouts _t_a_b_l_e_s Points to character tables or is NULL _m_a_r_k For passing back a *MARK pointer _e_x_e_c_u_t_a_b_l_e___j_i_t Opaque data from JIT compilation The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. There is a complete description of the PCRE native API in the ppccrreeaappii page and a description of the POSIX API in the ppccrreeppoossiixx page. PCRE 8.33 12 May 2013 PCRE_EXEC(3)