[pcre-dev] [Bug 1032] With MULTILINE option, cannot correct…

Kezdőlap
Üzenet törlése
Szerző: Richard Smith
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 1032] With MULTILINE option, cannot correctly handle searching for $ over CRLF
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1032




--- Comment #2 from Richard Smith <exim@???> 2010-10-20 17:24:51 ---
Many thanks for the speedy (immediate) response!

Re the options: I had not set any of the PCRE_NEWLINE_* options, but built the
engine with --enable-newline-is-any, and in the example search pattern I
explicitly included (*ANY).

The code doing the resuming is, in this case, my code calling pcre_exec. It
advances past the zero-length match by adding one to the search position. My
problem was where you said:

"If it is user code (which presumably knows it has set CRLF as a valid line
ending), surely it can decide for itself to skip over CRLF instead of just CR?"

Although my code can set an appropriate PCRE_NEWLINE_* pcre_compile-time
option, that can still be overridden by eg (*CR) at the start of the pattern
being compiled and consequentlty my code cannot rely on the option it had set
to determine whether to skip CRLF.

However, the pcretest program you have pointed me to appears to be a bit clever
than that and shows me exactly what I need to do: it is looking within the
block returned by pcre_compile to see what options are actually set, which
presumably includes the effects of (*CR) etc.

With this info I have all I need to resolve the problem and do not require
anything further from the engine; many thanks for your help!









--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email