Hi try this,
$line = '<br> 2<br> 3<br> 4'; $line =~ s#(?= )# #gsi; while ($line =~ s#( ) ( )#$1$2#gsi) { } print $line; o/p: <br>   2<br>    3<br>    4
In reply to Re: Replace a word in a line except for the last char of the word?
by gube
in thread Replace a word in a line except for the last char of the word?
by Ronnie Doorzon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |