in reply to Removing Poly-ATCG from and Array of Strings
update: non-greedy for less backtracking; another update to include length checking for each element.sub remove_poly { my ($array,$lim) = @_; grep { my $max_num = int($lim * length())-1; !/(.)(?:.*?\1){$max_num}/ } @$array; }
|
|---|