D
D
Denis Ruchiev2015-11-14 12:13:20
PHP
Denis Ruchiev, 2015-11-14 12:13:20

Line length limit preg_match_all?

preg_match_all searches for strings using a regular expression, but if the searched string is large, it returns an empty array. What is the maximum number of characters in the search string preg_match_all and how to bypass it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrew, 2015-11-14
@R0dger

maybe you have a line break there? so use modifier m
m modifier: multi-line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)

X
xmoonlight, 2015-11-14
@xmoonlight

https://regex101.com/
test..

D
Denis, 2015-11-14
@prototype_denis

php.net/pcre.configuration#ini.pcre.backtrack-limit

pcre.backtrack_limit integer
PCRE's backtracking limit. Defaults to 100000 for PHP < 5.3.7.

A
Andrew, 2015-11-14
@ntzch

Maybe this will work:
Will search from zero to five characters
More about this here: regexpstudio.com/ru/TRegExpr/Help/regexp_syntax.html starting with "Metacharacters - repetitions"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question