Problem with regular expressions for complex search operations in unicode names.

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

Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

Problem with regular expressions for complex search operations in unicode names.
The problem stems from the fact that my regex contains a negative condition
and I can't match all the names to a single performer name.
Someone can help, because for one it matches and for another it doesn't and so I keep mis-matching to a number of different song names.

Example:
^(?!.*(?:Time|Sweet)).*ARTISTname.*\.mp3$

Time, Sweet = example name of song

Instead of finding these two names to it also finds other names and does not match one artist name to another

Will search, but I have to add as many as 10000 repetitions of the same artist, so not optimizing the action, is bad

(NAME1.*ARTISTname|name2.*ARTISTname)


Not working in Everything 1.5a
.*(?:title|title|title).*DjB.*
or
regex:.*(?:title|title|title).*DjB.*
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

Could you please provide the filenames that mismatch and the exact regex search.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

But my regex doesn't even work in Everything. In all editors my expressions work, but never in Everything. It returns 0 results. So, I can't specify it. I only tested in the text editor with Boost.Regex engine and Onigmo and I also tested in MaserSeeker but CPU usage was 100% (overloading all CPU cores and high temperature and disappearing results)

Image
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

But my regex doesn't even work in Everything.
What do you mean by doesn't work?
What is the filename that you expect this to match?


I only tested in the text editor
What text did this match?



What is shown in the status bar on the right? (eg: are you matching case, do you have a filter enabled, is regex already enabled?)



regex:.*(?:Time|Sweet).*DjB.*
matches the following files for me:
C:\TEST\REGEX\sweet.djB.mp3
C:\TEST\REGEX\time.djB.mp3
If you create these files does Everything find them?



Does a search for:
regex:(Time|Sweet)
find any files?
Does a search for:
regex:DjB
find any files?
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

Actually, it has to search on multiple drives/partitions at the same time.
Example:

F:\Electro\【D独家】Millenium - Time(DjB Electro Rmx 2023).mp3
谢锋 - 前前左右(DjB Electro Rmx 2024 粤语).mp3
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

Thank you for the filenames.



The search:
regex:.*(?:Time|Sweet).*DjB.*
finds the following for me:
C:\TEST\REGEX\【D独家】Millenium - Time(DjB Electro Rmx 2023).mp3



The following filename:
谢锋 - 前前左右(DjB Electro Rmx 2024 粤语).mp3
does not contain Time or Sweet, it should not be matched.
-Are you expecting this to match?



What is shown in your Everything status bar on the right?
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

Regular expressions is already enabled under the Search menu.

regex: will not work with Regular expressions enabled under the Search menu.



Please disable Regular expressions from the Search menu and search for:

regex:.*(?:Time|Sweet).*DjB.*
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

Now it searches, but the results are incorrect/VERY BAD, for example.
“F:\English vs Carly Rae Jepsen - Good Time(DjBex Electro Rmx 2022).mp3”

OTHER TITLE / OTHER ARTIST NAME
Good Time WRONG TITLE
DjBex WRONG ARTIST NAME

sholulbe:
"Time"
sholdbe
"DjB"
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

That is an expected match.
You will need to improve your regex pattern.

For example:

regex:" - "(Time|Sweet)(" - "|\().*\bDjB\b

regex: = enable regular expressions
" - " = match space dash space (use double quotes to escape spaces)
(Time|Sweet) = match Time or Sweet
(" - "|\() = match space dash space or (
.* = match any character any number of times.
\b = match a word boundary.
DjB = match DjB
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

void wrote: Mon May 06, 2024 9:22 am That is an expected match.
You will need to improve your regex pattern.

For example:

regex:" - "(Time|Sweet)(" - "|\().*\bDjB\b

regex: = enable regular expressions
" - " = match space dash space (use double quotes to escape spaces)
(Time|Sweet) = match Time or Sweet
(" - "|\() = match space dash space or (
.* = match any character any number of times.
\b = match a word boundary.
DjB = match DjB
But it doesn't work, on all names!
A regular expression can be complicated if I want to match many different patterns in a single expression.

However, it is important to understand that regular expressions can have their limitations, especially when it comes to handling very long and complex patterns or large data sets to search.

Image
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Problem with regular expressions for complex search operations in unicode names.

Post by void »

There is spaces in your regex pattern.

Please escape spaces with double quotes.

It might be easier to wrap your entire regex pattern with double quotes:

regex:" - (Time|Sweet)( - |\().*\bDjB\b"
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

It doesn't work very correctly for most multiple names. I will send you privately the full pattern of names.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Problem with regular expressions for complex search operations in unicode names.

Post by Debugger »

Oops. Sorry. I made a mistake!
It works correctly. I didn't enter the artist correctly!
Now OK! Now it shows correctly and quite quickly the whole results!
Post Reply