in reply to Bgeinner regex question
This is what I think of as the standard approach to this sort of problem: it's my reflexive First Thought whenever I hear or read "overlapping match":
It has the advantages of using only a single capture group, and of needing no look-behind, which has the limitation in Perl regex of being fixed width.c:\@Work\Perl>perl -wMstrict -le "my $s = '123perl456perl789perl10'; ;; my @caps = $s =~ m{ (?= (.. perl ..)) }xmsg; ;; print qq{'$_'} for @caps; " '23perl45' '56perl78' '89perl10'
Update: Please see perlre, perlretut (especially Looking ahead and looking behind), and perlrequick.
Give a man a fish: <%-{-{-{-<
|
|---|