V
Vishal G
Hi Guys,
A Simple Substitution Problem
my $dna =
"***********acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******";
# I want to replace asterisk(*) with dot(.) if 10 or more
asterisks occur together
$dna =~ s/\*{10,}/./g;
print "$dna\n";
# output
.acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
As you can see 10 or more asterisk are replaced with dot but what
I want is this
...........acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
How to do it
Vishal
A Simple Substitution Problem
my $dna =
"***********acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******";
# I want to replace asterisk(*) with dot(.) if 10 or more
asterisks occur together
$dna =~ s/\*{10,}/./g;
print "$dna\n";
# output
.acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
As you can see 10 or more asterisk are replaced with dot but what
I want is this
...........acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
How to do it
Vishal