Can't EverythingInterface search for regex: properly like the Everything program window?

Test code:

function OnClick(clickData)
{
	var ev = DOpus.Create.EverythingInterface;
	var result = ev.Query('regex:\d{15}',"","f",14, 10);
	log("results count:" + result.count)

	if(result.count){
		log(result(0).fullpath)
		log(result(0).GetItem().realpath)
	}
}

function log(str){DOpus.Output(str,false,true);}

there is a file: C:!Temp\000000000000000.txt
seacrh for: regex:\d{15}

In Everything program window , this file is found.
But using EverythingInterface, it is not found.

PS. I don't want to use ev.Query('\d{15}',"r","f",14, 10);

This can find the file: regex:0{15}

ev.Query('regex:0{15}',"","f",14, 10);

I removed the bug-report tag because the query string is just passed to Everything and what it does with the string and flags is up to it, not down to anything Opus does (at least in general).

How (and whether) you can use things like regex: in the query string when calling Everything via its API, I am not sure. That's probably a question for the Everything developers, unless someone here happens to know.

But ed.exe from this : EverythingDopus
why ed.exe can search for regexp properly :expressionless_face:

Have you tried regex:\\d ?

ev.Query('regex:\d{15}',"","f",14, 10);
ev.Query('regex:\\d{15}',"","f",14, 10);
ev.Query('regex:\\\d{15}',"","f",14, 10);
ev.Query('regex:\\\\d{15}',"","f",14, 10);

All return 0 result.

So does ev.Query('\d{15}',"r","f",14, 10);

Are you using everything 1.5?
I've had some issue since I upgraded from 1.4 (which is officially supported) to 1.5a (which is not, since it's still alpha), and had to redesign some calls since then.

All I needed to do here was properly escape:

1 Like

Everything v.1.5.0.1396a

FWIW, you can enable Debug in EV 1.5 by going to Tools > Debug > Start Debug Logging to see what's going wrong when you search for something (even outside of EV).
For example, in your case, if you don't escape \d, you'll see this in the log:

IPC: execute query: regex:d{15}

1 Like

Use a ^ at the beginning like〈regex:^\\d{15}〉, will get the file 000000000000000.txt.
But it is still different from the behavior of the Everything window which not need a ^.

this is usefull! thank you.!

After asking Everything developer, I know the reason:

Looks like DOpus is cancelling the search if it takes longer than 1 second.
Can this timeout be adjusted in DOpus?

var result = ev.Query('regex:\d{15}',"","f",14, 10, 0, 3000); //OK now

On some computers with poor performance, the search time is longer than the default 1 second.

2 Likes