Re: [pcre-dev] Forward reference don't work when repeated tw…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: ND
CC: Pcre-dev
Subject: Re: [pcre-dev] Forward reference don't work when repeated twice or more
On Tue, 22 Nov 2011, ND wrote:

> PCRE version 8.20 2011-10-21
> /(a)(?2){2}(.)/
> abcd
> No match
>
> It seems that the whole string 'abcd' must be matched.


I have committed a fix. The patch is below.

Philip

--
Philip Hazel


--- pcre_compile.c      (revision 760)
+++ pcre_compile.c      (working copy)
@@ -6015,11 +6016,14 @@
               }
             }


-          /* Insert the recursion/subroutine item. */
+          /* Insert the recursion/subroutine item. It does not have a set first
+          byte (relevant if it is repeated, because it will then be wrapped 
+          with ONCE brackets). */


           *code = OP_RECURSE;
           PUT(code, 1, (int)(called - cd->start_code));
           code += 1 + LINK_SIZE;
+          groupsetfirstbyte = FALSE; 
           }


         /* Can't determine a first byte now */