Help me with this!!!

Ravi Teja webraviteja at gmail.com
Thu Feb 1 11:53:55 EST 2007


> > > It search a text inside that hex value.
> > > It works perfecly on a txt file but if I open a binary file (.exe,.bin
> > > ecc...) with the same value it wont work, why?
> > > Please help!
>
> > Because the pattern isn't in the file, perhaps.
>
> This pattern IS in the file (I made it and I double check with an hex
> editor).
> It display the file correcltly (print line) but...

No! Peter is right. Regular expressions match ASCII representation of
data, not hex. In simple terms, do you see your pattern when you open
the file in notepad (or other text editor)? You do not use regex to
search binary files.

Ravi Teja.




More information about the Python-list mailing list