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 » Mon May 25, 2009 2:34 am

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
Site Admin
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

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

Post by David » Mon May 25, 2009 10:16 am

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 » Mon May 25, 2009 11:23 am

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
Site Admin
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

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

Post by David » Mon May 25, 2009 12:03 pm

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 » Mon May 25, 2009 1:46 pm

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
Site Admin
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

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

Post by David » Tue Jun 02, 2009 6:41 am

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 » Sun Jun 07, 2009 1:38 pm

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
Site Admin
Posts: 430
Joined: Tue Mar 17, 2009 1:42 am

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

Post by David » Thu Jun 11, 2009 6:33 am

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 » Sat Jun 13, 2009 5:10 am

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