in reply to Question about speeding a regexp count
Another possibility:
$count{$1}++ while $seq =~ /(?=(.{1}))/g; $count{$1}++ while $seq =~ /(?=(.{2}))/g; $count{$1}++ while $seq =~ /(?=(.{3}))/g;
Update: woops, added the (?=) I initially forgot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question about speeding a regexp count
by Vynce (Friar) on Oct 13, 2005 at 19:56 UTC | |
by ikegami (Patriarch) on Oct 13, 2005 at 20:01 UTC |