Looks like a bug to me, whatever special casing .... doesn't happen the same way with grep
$ perl -Mre=debug -le " @F = qw( a b c DBIC A B C DANCER a b c ); for( +@F){print if /DBIC/.. /DANCER/ and ! // } " Compiling REx "DBIC" Final program: 1: EXACT <DBIC> (3) 3: END (0) anchored "DBIC" at 0 (checking anchored isall) minlen 4 Compiling REx "DANCER" Final program: 1: EXACT <DANCER> (4) 4: END (0) anchored "DANCER" at 0 (checking anchored isall) minlen 6 Compiling REx "" Final program: 1: NOTHING (2) 2: END (0) minlen 0 Guessing start of match in sv for REx "DBIC" against "DBIC" Found anchored substr "DBIC" at offset 0... Guessed: match at offset 0 Guessing start of match in sv for REx "DBIC" against "DBIC" Found anchored substr "DBIC" at offset 0... Guessed: match at offset 0 A B C Guessing start of match in sv for REx "DANCER" against "DANCER" Found anchored substr "DANCER" at offset 0... Guessed: match at offset 0 Guessing start of match in sv for REx "DANCER" against "DANCER" Found anchored substr "DANCER" at offset 0... Guessed: match at offset 0 Freeing REx: "DBIC" Freeing REx: "DANCER" Freeing REx: ""
$ perl -Mre=debug -le " @F = qw( a b c DBIC A B C DANCER a b c ); prin +t for grep { /DBIC/.. /DANCER/ and ! // } @F; " Compiling REx "DBIC" Final program: 1: EXACT <DBIC> (3) 3: END (0) anchored "DBIC" at 0 (checking anchored isall) minlen 4 Compiling REx "DANCER" Final program: 1: EXACT <DANCER> (4) 4: END (0) anchored "DANCER" at 0 (checking anchored isall) minlen 6 Compiling REx "" Final program: 1: NOTHING (2) 2: END (0) minlen 0 Guessing start of match in sv for REx "DBIC" against "DBIC" Found anchored substr "DBIC" at offset 0... Guessed: match at offset 0 Guessing start of match in sv for REx "DBIC" against "DBIC" Found anchored substr "DBIC" at offset 0... Guessed: match at offset 0 Matching REx "" against "A" 0 <> <A> | 1:NOTHING(2) 0 <> <A> | 2:END(0) Match successful! Matching REx "" against "B" 0 <> <B> | 1:NOTHING(2) 0 <> <B> | 2:END(0) Match successful! Matching REx "" against "C" 0 <> <C> | 1:NOTHING(2) 0 <> <C> | 2:END(0) Match successful! Guessing start of match in sv for REx "DANCER" against "DANCER" Found anchored substr "DANCER" at offset 0... Guessed: match at offset 0 Guessing start of match in sv for REx "DANCER" against "DANCER" Found anchored substr "DANCER" at offset 0... Guessed: match at offset 0 Freeing REx: "DBIC" Freeing REx: "DANCER" Freeing REx: ""


In reply to Re: Bug with "last successfully matched regular expression" (empty regex) by Anonymous Monk
in thread Bug with "last successfully matched regular expression" (empty regex) by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.