develooper Front page | perl.perl5.porters | Postings from February 2020

Re: Backporting ac3afc4b35 (regcomp.c: make \K+ and \K* illegal.)

Thread Previous | Thread Next
Karl Williamson
February 11, 2020 17:57
Re: Backporting ac3afc4b35 (regcomp.c: make \K+ and \K* illegal.)
Message ID:
On 2/11/20 10:12 AM, wrote:
> I thought we were talking about /foo (?:\K+)/, not /(?:foo \K)+/?
> I had assumed that \K only had to (effectively) set a pointer to what
> we're now pretending the match point is, and the second iteration
> of a \K{1,2} would just need to set the pointer to that same thing.
> If that's not the case, it would probably help to have a concrete
> example

We are talking about


where 'foo' is arbitrary.  Already {0,0} is optimized to OPFAIL.

The proposal would be to turn any other {0,n} into {0,1}, or more 
concisely '?', and any other {m,n} into {1,1} or simply \K.  (For {1,1}+ 
there would also have to be a non-backtracking marker added)

What should happen if foo contains a code block?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About