php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_pcre.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Andrei Zmievski <andrei@php.net> |
14 +----------------------------------------------------------------------+
15 */
16
17#ifndef PHP_PCRE_H
18#define PHP_PCRE_H
19
20#ifdef HAVE_BUNDLED_PCRE
21#include "pcre2lib/pcre2.h"
22#else
23#include "pcre2.h"
24#endif
25
26#include <locale.h>
27
28PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count);
29PHPAPI pcre2_code* pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count);
30
32#define pcre_module_ptr &pcre_module_entry
33
34#include "php_version.h"
35#define PHP_PCRE_VERSION PHP_VERSION
36
38
48
51
53 zval *subpats, bool global, zend_long flags, zend_off_t start_offset);
54
55PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str,
56 size_t limit, size_t *replace_count);
57
59 zend_long limit_val, zend_long flags);
60
63
70/* capture_count can be ignored, re is required. */
73
78#ifdef HAVE_PCRE_JIT_SUPPORT
79 bool jit;
80#endif
82 /* Used for unmatched subpatterns in OFFSET_CAPTURE mode */
85 /* General context using per-request allocator (ZMM). */
88
90#define PCRE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcre, v)
91
92#define phpext_pcre_ptr pcre_module_ptr
93
94#endif /* PHP_PCRE_H */
#define pcre2_general_context
Definition pcre2.h:840
#define pcre2_code
Definition pcre2.h:822
#define pcre2_match_data
Definition pcre2.h:844
#define pcre2_match_context
Definition pcre2.h:843
#define pcre2_compile_context
Definition pcre2.h:841
#define PHPAPI
Definition php.h:71
php_json_error_code error_code
Definition php_json.h:92
zend_module_entry pcre_module_entry
Definition php_pcre.c:3031
HashTable pcre_cache
Definition php_pcre.h:75
PHPAPI pcre2_match_context * php_pcre_mctx(void)
Definition php_pcre.c:3054
PHPAPI zend_string * php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count)
Definition php_pcre.c:1614
PHPAPI pcre2_compile_context * php_pcre_cctx(void)
Definition php_pcre.c:3064
php_pcre_error_code
Definition php_pcre.h:39
@ PHP_PCRE_JIT_STACKLIMIT_ERROR
Definition php_pcre.h:46
@ PHP_PCRE_BACKTRACK_LIMIT_ERROR
Definition php_pcre.h:42
@ PHP_PCRE_RECURSION_LIMIT_ERROR
Definition php_pcre.h:43
@ PHP_PCRE_BAD_UTF8_ERROR
Definition php_pcre.h:44
@ PHP_PCRE_NO_ERROR
Definition php_pcre.h:40
@ PHP_PCRE_BAD_UTF8_OFFSET_ERROR
Definition php_pcre.h:45
@ PHP_PCRE_INTERNAL_ERROR
Definition php_pcre.h:41
pcre2_general_context * gctx_zmm
Definition php_pcre.h:86
PHPAPI void php_pcre_pce_decref(pcre_cache_entry *)
Definition php_pcre.c:3075
PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags)
Definition php_pcre.c:2921
zend_long backtrack_limit
Definition php_pcre.h:76
struct _pcre_cache_entry pcre_cache_entry
Definition php_pcre.h:37
PHPAPI pcre2_code * pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count)
Definition php_pcre.c:892
zval unmatched_empty_pair
Definition php_pcre.h:84
PHPAPI pcre_cache_entry * pcre_get_compiled_regex_cache_ex(zend_string *regex, bool locale_aware)
Definition php_pcre.c:585
PHPAPI void php_pcre_pce_incref(pcre_cache_entry *)
Definition php_pcre.c:3069
PHPAPI pcre2_code * php_pcre_pce_re(pcre_cache_entry *)
Definition php_pcre.c:3082
PHPAPI pcre2_match_data * php_pcre_create_match_data(uint32_t, pcre2_code *)
Definition php_pcre.c:906
PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, zval *subpats, bool global, zend_long flags, zend_off_t start_offset)
Definition php_pcre.c:1156
zval unmatched_null_pair
Definition php_pcre.h:83
PHPAPI void php_pcre_free_match_data(pcre2_match_data *)
Definition php_pcre.c:928
PHPAPI pcre_cache_entry * pcre_get_compiled_regex_cache(zend_string *regex)
Definition php_pcre.c:885
zend_long recursion_limit
Definition php_pcre.h:77
PHPAPI zend_string * php_pcre_replace(zend_string *regex, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count)
Definition php_pcre.c:1586
PHPAPI pcre2_general_context * php_pcre_gctx(void)
Definition php_pcre.c:3059
PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, zend_long limit_val, zend_long flags)
Definition php_pcre.c:2564
Definition php_pcre.c:50
#define ZEND_END_MODULE_GLOBALS(module_name)
Definition zend_API.h:248
#define ZEND_EXTERN_MODULE_GLOBALS(module_name)
Definition zend_API.h:270
#define ZEND_BEGIN_MODULE_GLOBALS(module_name)
Definition zend_API.h:246
struct _zval_struct zval
int32_t zend_long
Definition zend_long.h:42
int32_t zend_off_t
Definition zend_long.h:44
struct _zend_string zend_string
struct _zend_module_entry zend_module_entry
struct _zend_array HashTable
Definition zend_types.h:386
zval * return_value