How to use multiregex

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

How to use multiregex

Post by Debugger »

How to use multi regex for:
folders, subfolders, names?
Each regex separately
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: How to use multiregex

Post by NotNull »

regex can't distinguish between a file and a folder. It's just text.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to use multiregex

Post by void »

With everything you can use the regex: modifier and define multiple regex searches, for example:
folder:regex:folders-only-with-this-regex-search regex:\\folder\\with\\these\\subfolders regex:a-search-to-match-the-name-part-only

Using a \\ in a regex search in Everything, will match the whole path and filename.
A space in Everything means AND, eg: regex:abc regex:123 means regex:abc AND regex:123
You can use | for OR, eg: regex:abc | regex:123 means regex:abc OR regex:123
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

Objects not found, i.e. the multi regex does not work correctly.
regex must be separate for:
Filename and In Directory

(?-i)^a_[a-z0-9]{8}\.txt | [E-Z]:\\ZK\s.*\\
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to use multiregex

Post by void »

Multiple regex searches will only work in Everything, and you must use the regex: modifier:
regex:(?-i)^a_[a-z0-9]{8}\.txt regex:[E-Z]:\\ZK\s.*\\

Regex must be disabled under the Search menu to use the regex modifier.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

void wrote:Multiple regex searches will only work in Everything, and you must use the regex: modifier:
regex:(?-i)^a_[a-z0-9]{8}\.txt regex:[E-Z]:\\ZK\s.*\\

Regex must be disabled under the Search menu to use the regex modifier.
Work.
Last edited by Debugger on Wed Oct 24, 2018 8:51 am, edited 1 time in total.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to use multiregex

Post by void »

Please check your regex searches, does
regex:(?-i)^a_[a-z0-9]{8}\.txt
find anything on its own?

Does
regex:[E-Z]:\\ZK\s.*\\
find anything on its own?

Try shortening your regex searches, does the following find anything:
regex:(?-i)^a_[a-z0-9] regex:[E-Z]:\\
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

regex:(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg regex:[E-Z]:\\ZK\s.*\\

regex:[E-Z]:\\ZK\s.*\\
It works, but it should only find subfolders:
-XXX_XXX
XXX_XXX
-XXX
XXX

X - number
other SUBFOLDERnames to exclude


Filename wrong search
regex:(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg
EXAMPLE:
K:\ZK USA\267739000_0\--4HezhXZiE.jpg <= It should not be found


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

Re: How to use multiregex

Post by void »

It works, but it should only find subfolders:
-XXX_XXX
XXX_XXX
-XXX
XXX
Are these folders directly under [e-z]:\ZK *\?

Please try searching for:
regex:"[E-Z]:\\ZK\s.*\\(-\d\d\d_\d\d\d|\d\d\d_\d\d\d|-\d\d\d|\d\d\d)\\"
regex:(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg
Please escape | with double quotes:
regex:"(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg"
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

Still wrong regex:
it should not match this type of name
y_7517b31c.jpg @ iMGSRC.jpg
w_d9710151.jpg.part

regex:"(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg|(?-i)^[a-zA-Z0-9-_]{11}\.jpg"

Leeter Disk E-Z:
The FOLDERname of the beginning of the ZK

EXAMPLE FOLDERNAME:
ZK 1
ZK USA 1
ZK Car 65 K
L:\ZK чуло 2\67561715_62563
L:\ZK чуло 2\67561715
L:\ZK чуло 2\-67561715_0
L:\ZK чуло 2\-67561715

Wrong regex. Several thousand results were not found, only about 200 results are shown
regex:"[E-Z]:\\ZK\s.*\\(-\d\d\d_\d\d\d|\d\d\d_\d\d\d|-\d\d\d|\d\d\d)\\"
SUBFOLDERNAME:
Always:
-d+_d+
d+_d+
-d+
d+
Last edited by Debugger on Wed Oct 24, 2018 10:32 am, edited 1 time in total.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to use multiregex

Post by void »

y_7517b31c.jpg @ iMGSRC.jpg
Please try:
regex:"(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg$"

The trailing $ means match end of filename.
Always:
-d+_d+
d+_d+
-d+
d+
Please try:
regex:"[E-Z]:\\ZK\s.*\\-?\d+(_\d+)?\\"

-? = match - if it exists
\d+ = match one or more digits
(_\d+)? = match _ followed by one or more digits -if it exists.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

Now it seems that the regex works correctly:

Code: Select all

regex:"(?-i)^[y|z|w]_[a-z0-9]{8}\.jpg$|(?-i)^[a-zA-Z0-9-_]{11}\.jpg$" regex:"[E-Z]:\\ZK\s.*\\-?\d+(_\d+)?\\"
The trailing $ means match end of filename.
"$" not required in other applications if set {8} or {11} characters
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to use multiregex

Post by void »

You might like to try merging this into one regex search:

[E-Z]:\\ZK\s.*\\-?\d+(_\d+)?\\(.*\\)?([y|z|w]_[a-z0-9]{8}|[a-zA-Z0-9-_]{11})\.jpg$

Please make sure Regex is enabled from the Search menu.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: How to use multiregex

Post by Debugger »

void wrote: Thu Oct 25, 2018 8:12 am You might like to try merging this into one regex search:

[E-Z]:\\ZK\s.*\\-?\d+(_\d+)?\\(.*\\)?([y|z|w]_[a-z0-9]{8}|[a-zA-Z0-9-_]{11})\.jpg$

Please make sure Regex is enabled from the Search menu.
It works in Everything, but I also use a good MasterSeeker program and informs me of an error:

Code: Select all


System.ArgumentException: parsing "(.*" - Not enough closing brackets.
Original log:

Code: Select all

System.ArgumentException: analizowanie "(.*" - Za mało nawiasw zamykających.
                                       w System.Text.RegularExpressions.RegexParser.ScanRegex()
                                       w System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
                                       w System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache)
                                       w #=qZJWc0mLBz7lxCZZrijayaAkhGOVi6IhMFy4SlawppP$b9T_1OnCKueOr25WM58fE.#=qPlBO0oK8wzHQ7GGtKMXXKW7SQNDWEAPUlBXcPLOe4PFikMIOkjXhja$OXWOShQLx(String #=q1$3J8ETTd3NCqf9si98Gyw==, Boolean #=qDzMOefTu6XnrvtDqg62m7w==)
                                       w #=qZJWc0mLBz7lxCZZrijayaAkhGOVi6IhMFy4SlawppP$b9T_1OnCKueOr25WM58fE.#=qG5rlzvKVDX0X6bjDtDIbKwNiZbPkEHsc_P2UZWsASx2YI1BN7P4EEKkoZeBVkoOg()
                                       w #=qhSmZU0Dsm4vykY_ZVEre1uxR4d5Ba6d2zzsjok9jeMU=.#=qbufCwxIYXbsgUHoxuoAtRooIKxkpBViTxNI4VStbt60=(#=qZJWc0mLBz7lxCZZrijayaAkhGOVi6IhMFy4SlawppP$b9T_1OnCKueOr25WM58fE #=qIHmaf5LojM5UH1f5KRQZ_Q==)
Post Reply