Identifying garbage characters 
Author Message
 Identifying garbage characters

Hello to the folks reading comp.lang.perl.misc!

I'm trying to write a regular expression to get rid of 'garbage'
characters in a binary file, where garbage is defined as anything that
isn't alphanumeric or punctuation readily available on a standard
keyboard.  Here's what I have so far, but I can't figure out what
characters I need to escape within a character class!  Maybe someone who
has done something like this can help me out.


$garbage = s/([^$word]+[$word]{0,3}[^$word]+)//g

- Brian



Wed, 23 Feb 2000 03:00:00 GMT  
 Identifying garbage characters

Hi Brian

What about something of that kind:

perl -pe '$_ =~ s/[\000-\040]//g' /bin/sh

Seems to work, but test for yourself:-)

Bye, per.

--

http://www.cs.inf.ethz.ch/~kistler/
Swiss Federal Institute of Technology, Zuerich, Switzerland
---------------------------------------------------------------------



Wed, 23 Feb 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Identifying single character in find and replace expressions...

2. filtering out garbage characters from post/get

3. garbage characters after html from cgi?

4. Identifying file format

5. -d not identifying directories

6. Identifying errors when using Getopts

7. reg.exp to identify sigs in mails

8. Net::Ftp perl protocol --Identify port---

9. Identifying an empty line in Perl (NEWBIE HELP)

10. How to identify a mix case word

11. Problem identifying directories

12. How to identify double bytes language?

 

 
Powered by phpBB® Forum Software