Search expression for a file under a specific directory.

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
zhaohs
Posts: 30
Joined: Sun May 03, 2009 9:56 am

Search expression for a file under a specific directory.

Post by zhaohs »

Hi all,

I want to search a file named myfile.pdf under the (sub)directory "C:\Program Files\", what's the search expression should I use for this case? I've tried the following one and it doesn't work at all:

"C:\Program Files\"myfile.pdf

Any hints on this issue? Thanks in advance.

Hongsheng.
David
Developer
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

Re: Search expression for a file under a specific directory.

Post by David »

Separate the terms with a space,
For example to search for C:\Program Files\ and myfile.pdf:

Code: Select all

"C:\Program Files\" myfile.pdf
zhaohs
Posts: 30
Joined: Sun May 03, 2009 9:56 am

Re: Search expression for a file under a specific directory.

Post by zhaohs »

Dear David,

Thanks for your reply.

I've just use the following one according to your suggestions:

"C:\Program Files\" .tex

Considering that I've MiKTeX 2007 installed at the default location on my system, it should return so many results by the above operation. But I just get nothing. Why does this happen?

Thanks again.
David
Developer
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

Re: Search expression for a file under a specific directory.

Post by David »

What search options do you have enabled?

Make sure regex is disabled.
zhaohs
Posts: 30
Joined: Sun May 03, 2009 9:56 am

Re: Search expression for a file under a specific directory.

Post by zhaohs »

Thanks, I've got it. I really enable the regex in my case. Now, I disable this option andy this issue is solved. Thanks a lot.

But I still cann't figure out why my issue should happen if I enable the regex, could you please give me some more hints?

Kind regards,
Hongsheng.
David
Developer
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

Re: Search expression for a file under a specific directory.

Post by David »

Regex uses \ to escape certain characters.
You would need to replace each \ with \\

For example to find all your myfile.pdf files in c:\program files use the following regex syntax:

Code: Select all

^c:\\program files\\.*myfile\.pdf$
See http://en.wikipedia.org/wiki/Regex for more information.
zhaohs
Posts: 30
Joined: Sun May 03, 2009 9:56 am

Re: Search expression for a file under a specific directory.

Post by zhaohs »

But the more strange thing is that:

1- When I enable the regex for everyghing, the following expression will give me nothing:

^c:\\program files\\.*\.tex$

2- When I disable the regex for everyghing, the following expression will give me right results:

"C:\Program Files\" .tex

Why does this happen?

Kind regards,
David
Developer
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

Re: Search expression for a file under a specific directory.

Post by David »

Using a \ in the search when regex is disabled will force match path on.
However, when regex is enabled you will need to toggle match path on manually.
zhaohs
Posts: 30
Joined: Sun May 03, 2009 9:56 am

Re: Search expression for a file under a specific directory.

Post by zhaohs »

Good, thanks a lot, I've got it.
David wrote:Using a \ in the search when regex is disabled will force match path on.
However, when regex is enabled you will need to toggle match path on manually.
Post Reply