averroes wrote:
> i have a string like this ';;;' with no quotes
> and i want subtitute it like this ';"";"";'
>
> my code is :
>
> my $string = ';;;' ;
> $string =~ s/;;/;"";/g ;
> print $string;
> but it prints ;"";;
You're modifying pos($string) in a way that
interferes with the pattern, so it won't
work as intendet. You might use on of the
following:
my $string = ';;;';
1) $string =~ s/;;/;"";/ while $string =~ /;;/;
2) $string =~ s/(?<=

(?=

/""/g;
3) $string = join '""', split '', $string;
instead.
Regards
M.