Questions - Smart Rules Regex

Hi,

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 https://www.devontechnologies.com/blog/20201110-organize-with-smart-rules

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)

Option.

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!