![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Cleaning the Logby Sigmund (Pilgrim) |
on Sep 02, 2002 at 13:55 UTC ( [id://194577]=perlquestion: print w/replies, xml ) | Need Help?? |
Sigmund has asked for the wisdom of the Perl Monks concerning the following question:
hello, this maybe silly to ask, worse if asked by a level 5 monk who needs only 75 points up to level 6, but I cannot solve my problem, so... here's the plain question: I often use a keylogger, please don't ask why, how and where, but what really matters is that its log looks similar to this: ------cuthere------------ hee{BS}llo, I'll be bnack{BS}{BS}{BS}{BS}ack next saturday. {BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}www.yahoo.com "keyloggers" + "linux" {BS}{BS}{BS} -----cuthere--------------- and so on. I wanted to write a perlscript to get rid of all those {BS} and substitute them with real backspaces, so that I could see what was REALLY written. so I tried this: but it fills the log with 0x08 characters instead of backspacing over the previous character. useless. so I thought of this regexp: s/.{BS}//g but it didn't work and I couldn't figure out why. then I did: after having found the first occurrence of .{BS} it deletes it and falls on the following "{" starting to search again, and finds the next one this way:
and so on. the real question is: how can i tell to perl that it must start searching each time FROM THE BEGINNING and not from the last position, so to be sure that each backspace is converted into a REAL backspace? thanks, SiG
Back to
Seekers of Perl Wisdom
|
|