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

Góra strony
Delete this message
Autor: Zoltán Herczeg
Data:  
Dla: Pcre-dev@exim.org
Temat: Re: [pcre-dev] Remove some restrictions of lookbehind assertions
> May be it not quite effective and still have restrictions but is useful.
> Is it simple to add such functionality?


Definitely not easy in JIT.

I have an alternative solution which might be able to solve many of the issues raised here. We already have (*SKIP:name), so we need to record specific string positions in the input, and since these are mark positions, they are even have a name.

I am open to other names, but I would propose the following control verbs:

(*MOVE:mark_name)
  - This verb changes the current string position to the position recorded by the last mark which name is mark_name.

(*SETEND:mark_name)
  - This verb changes the end position to the position recorded by the last mark which name is mark_name. If the position is smaller than the current string position, it is set to the current string position.

With these two opcodes you can move back in the string and you can even match parts of it again in a quite flexible way.

Regards,
Zoltan