Re: [pcre-dev] /x modifier bug when using # comments in RE ?

Kezdőlap
Üzenet törlése
Szerző: ph10
Dátum:  
Címzett: GAUTIER Herve
CC: pcre-dev@exim.org
Tárgy: Re: [pcre-dev] /x modifier bug when using # comments in RE ?
On Fri, 6 Jun 2014, GAUTIER Herve wrote:

> In my opinion, no. As I have used the pcretest program in a xterm on
> Linux, only a \n is added when I press the return key


Then why did you configure with

PCRE_CONFIGURE_OPTS += --enable-newline-is-crlf

?? On Linux, as you say, newlines are just LF, but that configuration
specifies that lines are terminated with two characters (CR, LF). So a
single LF character will not be treated as indicating a newline.

> I am not sure to understand the case it works.
> --enable-newline-is-lf and then in pcretest when re> input, add CRLF at each end of line ?


For use on Linux, you need --enable-newline-is-lf, which is actually the
default. If you use --enable-newline-is-crlf, you will have to input CR,
LF in order to terminate the comment.

> Anyway, in my configuration, what could lead to the different results
> when adding or not a comment in regex using # ???


Specifying --enable-newline-is-crlf caused the difference, because your
test input contained NO "newlines", and a comment is terminated by
newline. So your comment lasted until the end of the regex.

Philip

--
Philip Hazel