11.32. Substitute
$line = "abc123def"; $line =~ s/\d+/ /; # "abc def" $line =~ s/([a-z]*)(\d*)([a-z]*)/$3$2$1/; # "def123abc" $line =~ s/.../x/; # "x123def"; $line =~ s/.../x/g; # "xxx"; $line =~ s/(.)(.)/$2$1/; # "bac123def" $line =~ s/(.)(.)/$2$1/g; # "ba1c32edf"
|
Follow me: