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

Make sense, if only you could tell the regex engine to work left to right it would work...I can't assume the user wont hit a backspace twice...I dit it about 6 times typing this reply ;-)
  • Comment on Re: Re: should this backspace removal code be done better?

Replies are listed 'Best First'.
Re: Re: Re: should this backspace removal code be done better?
by shenme (Priest) on Oct 05, 2003 at 08:11 UTC
    Out of the mouths of dab'es ! Isn't this a 'sexeger' situation?

    Maybe someone should check my results, 'cuz I can't believe that adding in the reverse's doesn't impact these timings more.   I added a different routine to the mix benchmarked by antirice:

    sub badkcams { $a = reverse $s; $a =~ s[\cH[^\cH]|\cH$][]g while 1+index $a, chr(8); reverse $a; }
    I then ran the benchmark again:
               Rate    smack     new1       uk badkcams
    smack     191/s       --     -96%     -97%     -97%
    new1     5063/s    2547%       --      -7%     -25%
    uk       5469/s    2759%       8%       --     -19%
    badkcams 6715/s    3411%      33%      23%       --
               Rate    smack     new1       uk badkcams
    smack    42.4/s       --     -22%     -30%     -44%
    new1     54.7/s      29%       --      -9%     -27%
    uk       60.2/s      42%      10%       --     -20%
    badkcams 75.3/s      78%      38%      25%       --
    
    Am I reading this right?   It's faster?!?
    (This is Perl 5.8.0 AS build 806 running on WinXP.)