in reply to Re: Re: Searching binary data
in thread Searching binary data

I think you want ".", rather then "\S" in your regex

I copied that from the original post. I have no idea what sort of file is being used.

Also, I think your matching code will miss cases where there is more then one match per line.

The inner while (the statement modifier) takes care of that.

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re: Re: Re: Re: Searching binary data
by theorbtwo (Prior) on Mar 14, 2002 at 18:08 UTC

    Whoops, missed the statement modifer while; reading code too quickly while doing other things at the same time.

    As to using \S vs ., in your code it's matching arbitrary random data. In his, it's maching hex, so it's known nonspace.


    We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book