Finding a file containing only one type of character (nul) doesn't match all the right files regex:content

Found a bug in "Everything"? report it here
Post Reply
defza
Posts: 29
Joined: Thu Apr 18, 2019 12:49 pm

Finding a file containing only one type of character (nul) doesn't match all the right files regex:content

Post by defza »

If I search for

Code: Select all

regex:content:^\x00+$
on certain folder/file, then it only finds one file, but the many others are never matched.
All the files are just a bunch of nul characters, no newlines, nothing except nul characters.

Here are 2 samples that I expected to match but are not matching: https://drive.google.com/drive/folders/ ... sp=sharing
defza
Posts: 29
Joined: Thu Apr 18, 2019 12:49 pm

Re: Finding a file containing only one type of character (nul) doesn't match all the right files regex:content

Post by defza »

The solution is to add the "binary:" option, ie.

Code: Select all

regex:binary:content:^\x00+$

(which is a bit weird, as the \x is a binary character essentially, so not sure why it wouldn't match without the binary: switch)
void
Developer
Posts: 15349
Joined: Fri Oct 16, 2009 11:31 pm

Re: Finding a file containing only one type of character (nul) doesn't match all the right files regex:content

Post by void »

binary: is the correct answer.

binary: will treat your search and the file content as a byte stream.

Without binary:, Everything will treat the file as text.
You can still match NUL characters in text mode.

The issue occurs because there is a system iFilter for tff files and this iFilter is returning empty content when the file contains all NULs.

Alternative searches:
regex:binarycontent:^\x00+$
regex:utf8content:^\x00+$

(treat the content as binary or UTF-8).
Post Reply