Page 1 of 1
How to match filenames with [1] at the end?
Posted: Sun Oct 03, 2010 8:11 pm
by Joe Fox
I have tons of duplicates, all sets have a regular filename and the duplicate filename of filename[1].ext and I can't figure out how to select all files with [1] in the filename with the selection assistant.
Posted: Sun Oct 03, 2010 9:02 pm
by zz
In select by pattern, try entering *[1]*
Posted: Sun Oct 03, 2010 9:14 pm
by Joe Fox
I did that, and it matched all file names with the number 1 in them. I had also tried *[1].* but that matches any file name ending in a 1 (before the extension). The brackets are ignored. I was wondering if there was an escape character to have brackets be recognized as part of the string and not part of regular expression. Sort of like the \ and its function in perl. I've also tried \ for that matter, but no matches result.
Posted: Sun Oct 03, 2010 10:21 pm
by Fool4UAnyway
Did you try any of these?:
*\[1\]*
*\[1\]\..*
I'm not sure any of these will work.
Posted: Mon Oct 04, 2010 5:27 am
by Joe Fox
Like I said, I tried escaping the regex with \.. it didn't work.
Posted: Mon Oct 04, 2010 7:40 am
by DV
It doesn't use regex, it uses Like. It's not obvious, but I checked and you can escape the [ (which is a grouping character) using brackets:
*([)1(])*
DC2.0 has a plain text / regex matching option, so hopefully that should clear issues like this up!