Questions - Smart Rules Regex


Trying to setup a some smart rules and also using regex to automate a few things mainly document renaming but have been running into a few questions:

  1. Can I somehow use regular expressions in the conditions e.g. Filename contains \b[Rr]eceipts?\b instead of having Filename contains 4x with Receipt, receipt, Receipts, receipts?

  2. I somehow managed to setup a rule with nested All and Any as shown here

But can not figure out how I did it. Most of my rules have „All“ of the following are true but I would like to nest some with additional if ANY of the following are true but can’t find out how.

And lastly
3. How to split a document that is named with a string of numbers e.g. YYYYMM to YYYY_MM?
So for example that 202201 becomes 2022_01, I somehow can not figure that one out.

I would really appreciate some help!

Thank you so much!

See the matches conditions

Option or Cmd click on the plus sign (don’t know which and am away from my Mac)

Please use search in the forum for that. This question has been asked and answered so often now, that it’s a FAQ.

See the matches conditions

Matches supports operators and wildcards but not full RegEx.

Option or Cmd click on the plus sign (don’t know which and am away from my Mac)


Also, from the Documentation > Windows > Sidebar: Smart Group and Rule Editor section in the built-in Help and manual

@Antergosgeek: As @chrillek mentioned, this is a widely discussed topic in the Automation section.

Thank you so much! And yes, will do that. Have not actually looked in the forum for this one just checked and googled regular regex but have not been able to get it going. I am sure I will be able to find it.

Thank you so much for the rest of your answers!

Awesome, thank you!

This is also super helpful, thank you!

1 Like

In the last one I think I found it:

Script Rename using RegEx
Select the files you want to rename.
Run the script.

Source: ([0-9]{4})([0-9]{2})
Destination: \1_\2

Works perfect! Sorry that I did not think to search right here.

Just posting for completion!

Sorry, the correct term is scan, not match. I hope

Still have to check on that one. Have not tried that yet

After looking into the scan function. How would that work at that point?
Isn’t only available after the “finding” the document so basically in the bottom section of here:

So how would I go about substituting the top part? Or did I misunderstand you?

Sorry, I was thinking about the „change name“ part. You might rework your logic for the top part using matches, which allows basic wildcard matching. See one of @BLUEFROG‘s posts here.

1 Like
  1. String matches are not case-sensitive.
  2. I’d suggest using Name matches instead of Filename. A filename may not be the same as the document’s name.

Note the matched file above the criteria editor.

1 Like

Thank you to both of you. Makes sense. Going to try matches. Unless there is another reason might stick to filename because that fits my workflow. I am naming receipts on scan&import accordingly but just want to protect against inconsistencies. Once imported I basically want the documents to be filed accordingly and automatically where possible. So unless you see an advantage using Name for that use case I might stick to Filename.

But this was very enlightening and helpful! Thank you so much!

Name is more commonly used and referenced. I would use it instead of filename. Filename is the name in the filesystem and is much less often used.

You’re welcome :slight_smile:

Makes sense, I will give it a try.

Lastly a practical question: Do you recommend combining rename and move operations in one smart rule or would it be best to setup two separate rules for that?

Unless you had a reason to make such granular smart rules, I would combine the actions into one smart rule.

Got you, thank you!