my $str = 'abccabbcabc'; my %seen; while ($str =~ /(.)/g) { printf "character %s found at pos %d, reps %d\n", $1, pos($str), $ +seen{$1} if $seen{$1}++; }
In reply to Re^2: Regex to only show 2nd character of the same character in a string
by salva
in thread Regex to only show 2nd character of the same character in a string
by wtritchie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |