> # With the new :ov (:overlap) modifier, the current rule will match at all
> possible character positions (including overlapping) and return all matches
> in a list context, or a disjunction of matches in a scalar context. The
> first match at any position is returned.   
> 
>     $str = "abracadabra";
> 
>     @substrings = $str ~~ m:overlap/ a (.*) a /;
> 
>     # bracadabr cadabr dabr br

Maybe I'm wrong here, but I'd get
$str = "abracadabra";
         bracadabr
     cadabr
       dabr
         br
(so far identical), but then I'd also expect
  bracad
     cad
       d
  brac
     c
  br

which gets me to the question, if there'll be some elements multiple times in 
the array (they should), and in which order they appear (first match to 
(nth .. 1st) match, 2nd to (nth .. 2nd)) and so on ...

BTW: will
      $str = "abracadabra";
 
      @substrings = $str ~~ m:overlap/ a (.*) (b|d) /;
get some empty strings as well (I believe it should)?


Regards,

Phil

Reply via email to