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:
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:
and replaces it with:
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.
Finally got them to upload.
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.
There’s no need to capture the prefix since you don’t appear to be using it.
This will work though you’d have to add the proper event trigger…
It yields results like so…
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?
? is a repetition operator but it only applies to the second
Technically you could have used
^(cc.?-)(.*)$ which would also match