regexp question - extracting wanted ascii characters only?

From: Date: Wed, 04 Apr 2001 09:23:41 +0000
Subject: regexp question - extracting wanted ascii characters only?
Groups: php.general 
Request: Send a blank email to php-general+get-47001@lists.php.net to get a copy of this message
Hi, I need to do a simple thing. I want to read a binary file (e.g., microsoft word, excel etc) and then extract only the text from it. I am using simple fopen() and fread() and when I print out the contents of the file, it returns me the text but apart from the text, there is some junk which is probably because of the file being binary. Is it possible through the regexp to specify that I only want some of the ASCII characters from the binary stream? Here is the perl equivalent: /([\040-\176\s]{3,})/g I want only those words that are minimum 3 characters and I want the characters to match the ASCII numbers from 40 to 176. Would really appreciate any help Thanks! __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

« previous php.general (#47001) next »