I have a huge number of files with names like:
base.pdf
base(1).pdf
base(2).pdf
I thought I would try a regex to show all file of this pattern
part of it is easy:
regex: \(\d+\)\..+$
This leaves out the ones with out the sequence numbers -- how do I include them?
Thanks!
regex to find files with sequential names
Re: regex to find files with sequential names
You may need to add more constraints, as the following will match almost everything:
regex:(\(\d+\))?\.
( and ) = grouping
? = match previous element zero or one times.
Example:
regex:base(\(\d+\))?\.pdf
The following search with Everything 1.5 will show files containing ( digits+ ) where a file without ( digits+ ) exists.
For example, show base(1).pdf when base.pdf exists:
regex:^(.*)\(\d+\)(\..*)$ fileexists:\1\2
and the inverse, show base.pdf where a base(1).pdf exists:
regex:^(.*)(\.[^.]*)$ fileexists:\1(1)\2
Combining these might get you close to what you want:
regex:\(\d+\)\..+$ | < regex:^(.*)(\.[^.]*)$ fileexists:\1(1)\2 >
--This will list:
base.pdf (when base(1).pdf exists)
base(1).pdf
base(2).pdf
Everything syntax:
| = OR
< and > = Grouping
regex:(\(\d+\))?\.
( and ) = grouping
? = match previous element zero or one times.
Example:
regex:base(\(\d+\))?\.pdf
The following search with Everything 1.5 will show files containing ( digits+ ) where a file without ( digits+ ) exists.
For example, show base(1).pdf when base.pdf exists:
regex:^(.*)\(\d+\)(\..*)$ fileexists:\1\2
and the inverse, show base.pdf where a base(1).pdf exists:
regex:^(.*)(\.[^.]*)$ fileexists:\1(1)\2
Combining these might get you close to what you want:
regex:\(\d+\)\..+$ | < regex:^(.*)(\.[^.]*)$ fileexists:\1(1)\2 >
--This will list:
base.pdf (when base(1).pdf exists)
base(1).pdf
base(2).pdf
Everything syntax:
| = OR
< and > = Grouping