Filtering subfolders with RegEx

A swapping-ground for Regular Expression syntax

Filtering subfolders with RegEx

Postby PedroElRitmo » Thu Dec 15, 2016 9:02 pm

Apologies if there's an answer to this already.

I need to filter the files (and only the files) in a specific subfolder of all folders that match the following RegEx:

[A-Z]{2}\d{8}-\d{2}_([A-Za-z])*

For example:

AB12345678-09_HelloWorld
FG10203040-50_GoodbyeCruelWorld

While the Filters (12) RegEx correctly filters these folders, it won't allow me to specify a (literal) subfolder of these folders:

[A-Z]{2}\d{8}-\d{2}_([A-Za-z])*\\X\\Y\\Z

That is, the files I'm interested in are:

AB12345678-09_HelloWorld\X\Y\Z\*.*
FG10203040-50_GoodbyeCruelWorld\X\Y\Z\*.*

Can this be done?
PedroElRitmo
 
Posts: 2
Joined: Thu Dec 15, 2016 7:50 pm

Re: Filtering subfolders with RegEx

Postby therube » Fri Dec 16, 2016 6:00 am

(I'm not quite following what you're looking to do, but...)

I'll often use Everything (1.4.1 Beta, http://voidtools.com/downloads/) in conjunction with other utilities (like BRU).
Everything is great at finding files.


So plug your regex into Everything, then drag those files into BRU.
(Drag & drop into BRU does not work reliably, consistently, so if it farts on the first go, just do it a second time & that usually gets it.)

Everything -> regex:[A-Z]{2}\d{8}-\d{2}_([A-Za-z])*


Might help you out.
therube
 
Posts: 316
Joined: Mon Jan 18, 2016 6:23 pm

Re: Filtering subfolders with RegEx

Postby KenP » Fri Dec 16, 2016 3:25 pm

therube wrote:I'll often use Everything (1.4.1 Beta, http://voidtools.com/downloads/) in conjunction with other utilities (like BRU).
Everything is great at finding files.

What a great little programme, thanks for posting that :D

If I'm understanding the OPs post correctly he wants to use the regex only in specific sub-folders, so after having a little play with "Everything" I think the OP may need to add the folder name to the filter list i.e. "specific folder name"\, then with that filter selected tick "Enable Regex" from the "Search" menu before using the Regex to filter the files and drag them to BRU.

Having said that, there may be another way of using regex in specific sub-folders that I haven't seen.
KenP
 
Posts: 193
Joined: Sat Jul 30, 2016 11:25 am

Re: Filtering subfolders with RegEx

Postby PedroElRitmo » Sat Dec 17, 2016 8:24 pm

Thanks for your replies.

I already had 'Everything' but alas that doesn't work either. It seems to me that BRU and Everything only work on individual file or folder names, they won't filter on the fully-qualified path or any portion of it.

If BRU supported an "import file list" option that would help as I can easily create the file list from my regex. Am I right in thinking [CTRL]+drag/drop is the only way to get files into BRU beyond the built-in search facilities?
PedroElRitmo
 
Posts: 2
Joined: Thu Dec 15, 2016 7:50 pm

Re: Filtering subfolders with RegEx

Postby therube » Mon Dec 19, 2016 4:30 pm

(A subset of your RegEx...)

You can use the path: function, or type in the path, or parts of it, or ...

Image
therube
 
Posts: 316
Joined: Mon Jan 18, 2016 6:23 pm


Return to Regular Expressions