著者: GAUTIER Herve 日付: To: pcre-dev@exim.org 題目: Re: [pcre-dev] /x modifier bug when using # comments in RE ?
On 09/06/2014 17:36, ph10@??? wrote: > Re: [pcre-dev] /x modifier bug when using # comments in RE ?
>
> On Mon, 9 Jun 2014, GAUTIER Herve wrote:
>
> > From my point of view, minor remaining problems are:
> > - Impossible to enter the sequence CR LF when defining RE using
> pcretest.
>
> It does seem impossible interactively, but you could of course have it
> in a file.
>
Ok.
Haven't test. Nice feature will to able to enter some character as "\r"
as in data for example.
But it is good to know that it is possible using file.
>
> > - Impossible to choose independently the newline for RE and DATA.
>
> That is not correct. You can set any of the PCRE_NEWLINE_xxx options
> either for pcre_compile() or pcre_exec().
>
Ok. So:
- if PCRE_NEWLINE_xxx is used in pcre_compile() it set newline sequence
only for RE
- if PCRE_NEWLINE_xxx is used in pcre_exec() it set newline sequence
only for DATA.
It sounds good for me.
>
> > - I still do not understand why when PCRE is compiled with
> > --enable-newline-is-crlf on a system (Linux) which has LF as newline,
> > using /x modifier, PCRE lib or prcetest ignored the newlines (LF) in
> > my RE:
>
> It did not ignore them. It treated them as white space, but *not* as
> newlines.
>
Ok.
So pcretest ignores my newlines. That is not what I was expected to.
To conclude my use case, using --enable-newline-is-anycrlf close all my
problems !
Thank for sharing all information Philip !
And again, good work !