in reply to Converting BCBCBCBCBCCCB to (BC)^{5}CCB
This code not tested .. that's just the general idea.$Code = "BCBCBCBCBCCCB"; $What = "BC"; $Code =~ m/($What)+?/; $Exp = length ( $1 ) / length ( $What ); $Code =~ s/$1/($What)^($Exp)/e;
--t. alex
"Of course, you realize that this means war." -- Bugs Bunny.
|
|---|