I am trying to use a smart rule to rename files in the database. Specifically, the scanned documents were imported with a filename like this:
CCO-2020-05-22_7.pdf
I am trying to remove the prefix such as “CCO-” at the beginning of each file. I created a REGEX rule that scans the name for:
^(cc?-)(.*)$
and replaces it with:
\2
It does not seem to do anything. I have an excellent renaming utility (NameMangler), but I know that I cannot use this to rename files after they are already in the database.
I would have posted screenshots, but this web site does not seem to want them.
Does the Smart Rule match the records in your next screen capture? It doesn’t look like it does, from what I can see on the left side there’s only one record matched.
This worked perfectly. Thanks.
Question: Why didn’t my Regex query work? You say there is “no need to capture the prefix,” but why did the query not work?
The ? is a repetition operator but it only applies to the second c.
Technically you could have used ^(cc.?-)(.*)$ which would also match CC-2020-01-25_4.txt.