$ perl -le' my $string = q/5424123412345678/; $string =~ s/.(?=.{4})/*/g; print $string;' ************5678 Update: $ perl -le' my $string = q/5424123412345678/; $string =~ s/(?<=.{4}).(?=.{4})/*/g; print $string;' 5424********5678
In reply to Re: Golf: Replacing part of a string with "*"
by jwkrahn
in thread Golf: Replacing part of a string with "*"
by kwaping
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |