How to copy/save ONLY all the highlighted titles into notepad/text editor?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by Debugger »

I wrote a regular expression to highlight song titles in Everything 1.5a, but my question is how to copy or save ONLY all the highlighted titles into notepad/text editor?

Code: Select all

(?<= - )[^\(\)]+(?=\()
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by void »

Uncheck Regular Expressions from the Search menu.
Search for:
regex:"(?<= - )[^\(\)]+(?=\()" addcol:regmatch0
Select all your files.
From the File menu, under the Copy Properties submenu, click Copy Regular Expression Match 0
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by Debugger »

I have a problem with a regular expression. It should only match the artist name in parentheses, and it matches the name with the first parenthesis.

\(([^)\s]+)\b

It should be:
1231-苇 - 风中有的云(DjK Electro Remix)[com].mp3

is:
1231-苇 - 风中有的云(DjK Electro Remix)[com].mp3
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by void »

Use Regular Expression Match 1 (instead of match 0)

Match 0 is the entire match.
Match 1 is the first capture inside the ( )



Everything will always highlight with Regular Expression Match 0



Uncheck Regular Expressions from the Search menu.
Search for:
regex:\(([^)\s]+)\b addcol:regmatch1
Select all your files.
From the File menu, under the Copy Properties submenu, click Copy Regular Expression Match 1
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by Debugger »

This only works when you "copy", but it still highlights the bracket in Everything, and in all text editors it still highlights the bracket, and I have no idea how to solve this problem. I'm only interested in the name, without that unwanted bracket.
I have tried with many regular expressions to no avail.
I would also like to work with the names in any text editor after copying.

Test regex:
\(([^)\s]+)\b
\((\w+)(?=\s|\))
\((\S+?)\)
\((.*?)\)
\(([^)\s]+)\)
\((\w+).*?\)
\(([^)\d]+)\)
\(([^)]+)\)
\((\w+)




Image
Last edited by Debugger on Wed May 08, 2024 10:35 am, edited 1 time in total.
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by void »

Use the following prefix:

regex:(?<=\()

For example:

regex:(?<=\()([^)\s]+)\b
regex:(?<=\()(\w+)(?=\s|\))
regex:(?<=\()(\S+?)\)
regex:(?<=\()(.*?)\)
regex:(?<=\()([^)\s]+)\)
regex:(?<=\()(\w+).*?\)



The only way not to capture something is using look-around assertions
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to copy/save ONLY all the highlighted titles into notepad/text editor?

Post by Debugger »

Thanks. Works well with this expression,

Code: Select all

regex:(?<=\()([^)\s]+)\b
and this

Code: Select all

regex:(?<=\()[^)\s]+
Post Reply