Re: [pcre-dev] PCRE 7.3 release candidate for testing

Top Page
Delete this message
Author: Sheri
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] PCRE 7.3 release candidate for testing
Philip Hazel wrote:
>
>> It would be nice (at some point) to have internalized newline options
>> (that work only at the start of the pattern).
>>
>
> I could implement something like
>
> (?N=CR)rest-of-pattern
>
> fairly easily - with no recognition anywhere other than at the very
> start of the pattern. But I'm wondering whether this is getting to be
> very special-purpose?
>
> Anybody else on this list have views?
>
> Philip
>
>

I haven't seen any apps other than ours extending the newline options to
user. I previously suggested to Nuno that newline options be made
available to PHP users (don't know the status). With your fix, the
option would already be there. Without it, users are stuck with
whichever newline option was made the default. Which newline would be
wanted has more to do with the user's data than anything else, and is
especially useful for processing multiline data with ^ and $ matching
where they should.

About the issue of it needing to be at the start of the pattern, could
it possibly also be supported after a leading (?#comment) ?

Regards,
Sheri