In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/39ce401c1db32fe69d69d11cfd7b62071e52f43a?hp=62286d5869e7680741523d2a11be77cb79b83c99>

- Log -----------------------------------------------------------------
commit 39ce401c1db32fe69d69d11cfd7b62071e52f43a
Author: Karl Williamson <[email protected]>
Date:   Fri Mar 22 14:54:33 2019 -0600

    PATCH: [perl #133984] Failure in lookbehind
    
    I thought that lookbehind assertions weren't supposed to look beyond the
    current position; but this CPAN module demonstrates that they can look
    ahead as well.
    
    I built some infrastructure to prevent them from looking ahead.  In
    part, this is because Unicode recommends that pattern matching have the
    ability to restrict the area of the target being matched.  That
    infrastructure is not needed at this time.  But I think we should leave
    it in for now anyway, as we see what other bugs the variable length
    lookbehind changes may have caused.
    
    So this patch just takes the easy way out, and at the place where it
    would restrict the area searched, it uses the full width.  It's a one
    line change.

-----------------------------------------------------------------------

Summary of changes:
 regexec.c           | 4 ++--
 t/re/pat_advanced.t | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/regexec.c b/regexec.c
index 45a817a7b2..00e822d729 100644
--- a/regexec.c
+++ b/regexec.c
@@ -8725,8 +8725,8 @@ NULL
                 PERL_UINT_FAST8_T back_count = scan->flags;
                char * s;
 
-                /* Lookbehind ends here */
-               ST.end = locinput;
+                /* Lookbehind can look beyond the current position */
+               ST.end = loceol;
 
                 /* ... and starts at the first place in the input that is in
                  * the range of the possible start positions */
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index 21a43b8fe2..98a899499d 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -2345,6 +2345,10 @@ EOF
     is (scalar split(/\b{sb}/, "Don't think twice.  It's all right."),
         2, '\b{wb} splits sentences correctly');
 
+    ok "my/dir/audio_07.mp3" =~
+     qr/(.*)\/(.*)\/(.*)\.(?<=(?=(?:\.(?!\d+\b)\w{1,4}$)$)\.)(.*)$()/,
+     "[perl #133948]";
+
 
     # !!! NOTE!  Keep the following tests last -- they may crash perl
 

-- 
Perl5 Master Repository

Reply via email to