in reply to Re: Re: Re: should this backspace removal code be done better?
in thread should this backspace removal code be done better?

Catering for multiline input and assuming backspaces at beginning of lines should simply be removed:

$s = "\b\bthis is an\b correct\b\b\b usage\b\n\b2nd\n\b\b3rd\n"; $s =~ s/^[\b]+//mg; 1 while $s =~ s/[^\b][\b]//g;

/-\

  • Comment on Re: Re: Re: Re: should this backspace removal code be done better?
  • Download Code