Do you have a question? Post it now! No Registration Necessary. Now with pictures!
December 28, 2009, 2:23 pm
rate this thread
From your source:
There are some size limitations in PCRE but it is hoped that they will
never in practice be relevant.
The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE
is compiled with the default internal linkage size of 2. If you want to
process regular expressions that are truly enormous, you can compile
PCRE with an internal linkage size of 3 or 4 (see the README file in
the source distribution and the pcrebuild documentation for details).
In these cases the limit is substantially larger. However, the speed
of execution is slower.
The way I read that: There is a limitation to the length of the applied
pattern, not the data (string) it is matched against.
So you have to worry about this limitation if your regular expression
itself becomes that huge.
Is your regular expression itself that huge?
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
On Mon, 28 Dec 2009 07:26:50 -0800 (PST), alberto wrote:
There are a veritable dumptruck-load of possible reasons why a pcre
might not be matching what you think it should. The key to knowing
precisely WHICH reason it might be depends on what error message you're
getting (if any), what your needle is, what your haystack is, and what
match pattern you're using. Supply those things, and we'll be able to
help a lot more.
For every rational explanation there are an infinite number of
-- Staples' Observation