I hope that my question has not already been posed by someone else, since I tried to look almost everywhere in the site but I couldn\'t manage to find an answer.
My
The following uses a zero-width assertion (I believe that's what it's called).
#!/usr/bin/perl use strict; use warnings; $_ = "betalphabetabeta"; while (/(?=(alpha|beta))/g) { print $1, "\n";
Prints:
C:\Old_Data\perlp>perl t9.pl beta alpha beta beta