... $str='caaabbbaaac'; $str=~m/aaa(.*)aaa/; $b=$1; # sollte jetzt bbb sein, ist aber noch aaa