Search in which part of path being RegEx

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Benny.Tordrup
Junior Member
Junior Member
Posts: 5
Joined: 2021-03-17, 07:41 UTC
Location: Denmark
Contact:

Search in which part of path being RegEx

Post by *Benny.Tordrup »

Hi

I'm trying to create a search that will look for .config files in any directory where the path to the config files contains "Release" or "release". I tried using a @file.txt in Search in with the following line in file.txt:

Code: Select all

c:\Git\Visma\VismaBusiness\VismaBusiness\<([\w.]+\\)*[Rr]elease\\(.+\\)*\.config$
The first part is fixed - it is the path to a repository, but below there, there are a multitude of projects that all contains Release and Debug folders in the build output. I'm trying to get only the ones for release only - hence the regular expression part before \.config$

If I use this line in file.txt, then I find all .config files (unfortunately also the ones outside Release folders.

Code: Select all

c:\Git\Visma\VismaBusiness\VismaBusiness\<\.config$
How can I construct the RegEx so TC will return only the .config files containing Release or release in the path?

Best regards,

Benny Tordrup
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Search in which part of path being RegEx

Post by *Stefan2 »

1) Menu Commands > Search...
Search for: release
Click at [Feed to listbox] (Filelist is replaced by search result, use f.ex. backspace-key to go back)

2) Menu Commands > Search...
Search for: config
Select a result and click on [Go to file]

3, 4, 5, 6 ...)
Menu Commands > Search...
Select a result from last search and use [Go to file] again




Something like this?


- - -


Edit, here is an tip from Mr. Ghisler >> "F2 search in found files/folders"

1) Menu Commands > Search...
2) Search for: release (here: find items with names containing the word "release") **
All folders with "release" are found.
3) Choose"F2 search in found files/folders" <<<< new tip
4) Search for: config (here: find items with names containing the word "config") ***
All files with "config" are found.
5) Select a result and click on [Go to file]

** For to find folders (or files) only, go to advance tab and check the attributes.
*** For to find items with absolute name "config" and not "config new" too, add an trailing dot and search for "config."




 
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Search in which part of path being RegEx

Post by *petermad »

Another approach without RegEx:

General tab:
Search for: .config
Searxh in: c:\Git\Visma\VismaBusiness\VismaBusiness\

Plugins tab:
Plugin: tc
Property: path
OP: contains
Value: release
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Benny.Tordrup
Junior Member
Junior Member
Posts: 5
Joined: 2021-03-17, 07:41 UTC
Location: Denmark
Contact:

Re: Search in which part of path being RegEx

Post by *Benny.Tordrup »

Hmmm. A bit tricky.

Is it possible to make a restriction when searching for release that it should match the full folder name and not return folders like "mergeFromRelease" or "Release17.00"?
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Search in which part of path being RegEx

Post by *white »

2Benny.Tordrup
Regular expressions in a list file (@file.txt) will only be matched against the filename, not the path. So this cannot be done using a list file, you have to use other methods.
Benny.Tordrup
Junior Member
Junior Member
Posts: 5
Joined: 2021-03-17, 07:41 UTC
Location: Denmark
Contact:

Re: Search in which part of path being RegEx

Post by *Benny.Tordrup »

petermad wrote: 2022-08-11, 11:58 UTC Another approach without RegEx:
Peter, that one saved my day :-)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Search in which part of path being RegEx

Post by *petermad »

2Benny.Tordrup
s it possible to make a restriction when searching for release that it should match the full folder name and not return folders like "mergeFromRelease" or
Use:
Value: \release\
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Search in which part of path being RegEx

Post by *white »

Benny.Tordrup wrote: 2022-08-11, 12:03 UTC Is it possible to make a restriction when searching for release that it should match the full folder name and not return folders like "mergeFromRelease" or "Release17.00"?
Look at the plugins tab of the search window. You can use regex on the path there if you wish.

Plugins tab:
Plugin: tc
Property: path
OP: regex
Value: <your regular expression>
Post Reply