in reply to ascii problem

The basic regex would be
s/.\^H//
This would get the inner match. Then...
while ($var =~ /.\^H/) { $var =~ s/.\^H//; }
forgot the 's', sorry.

Replies are listed 'Best First'.
Re^2: ascii problem
by samtregar (Abbot) on Jun 01, 2006 at 20:11 UTC
    That only works if he really has two characters for backspace - "^" and "H". More likely he's got real backspaces, aka \x08 in Perl (among many ways to write that, of which ^H is not one).

    -sam

      among many ways to write that, of which ^H is not one

      But "\cH" is.

      If it is in a string then it isn't a backspace character. It is the characters '^' and 'H'.
        I don't know what makes you so sure. His post is ambiguous, but I take it as significant that he claims to be working on a keylogger's output. That would almost certainly have real backspaces not "^" and "H". Of course it's impossible to be sure - he could have a screen-cap of a keylogger...

        -sam

        Certainly the Unix utility script records the backspace as the single character with decimal value 8, this is what I would expect from any "keylogger" as that is the "value" of the key that was pressed.

        /J\