@matches=$string=~/(K|R)/g;
foreach $a(@matches) { print index($string, $a)."\n"; }