Re: [pcre-dev] Remove some restrictions of lookbehind assert…

Kezdőlap
Üzenet törlése
Szerző: Zoltán Herczeg
Dátum:  
Címzett: Pcre-dev
Tárgy: Re: [pcre-dev] Remove some restrictions of lookbehind assertions
> I think MOVE verb like a goto operator in programming languages impacts
> the clarity of pattern structure and make it error-prone. It is
> undesirable in my opinion.


Yes. The idea has already dropped.

> I think it will be better to use standard "(?<=)" for lookbehinds, not


The problem is that you cannot "reverse" a pcre pattern. Even if we want to support simple constructs, we would need backward readers, and reversed byte-code processing, which is hard with the current byte code format.

If we would use your idea for doing (0,n-1) match, that could be too slow for large subject, and people would complain.

Before we chose anything to implement, it would be good to know about the problems we want to solve. Especially whether we can solve them with the current construct. I mean you can always construct artificial use cases for certain features, but are they necessary or you can solve them other ways.

It is also frequent that you combine regexes with other script languages. For example you split a string first into records, and do some search in each record, rather than trying everything with one complicated regex.

One problem I have been thinking about lately how can you search regexps in JavaScript, since a slash can be a division operator, not just the start of a regex. I think I could do it if there would be a control verb, which compares the current MARK to a string, effectively making MARK a string variable. But this might not be a use case for regexes.

Regards,
Zoltan