Thank you @BLUEFROG, that worked on a small test. However, I just ran it on a larger batch and it removed the whole filename except the last word (much like the expected results from the screenshot below)
As I’m still in the process of learning how to use and manipulate RegEX, could you please explain why my RegEx in the example above didn’t work in DEVONthink whereas it did in A Better Rename?
Is there something wrong with the syntax I posted above that DEVONthink doesn’t interpret?
Also, does DEVONthink not recognise $ in the destination pattern, only \?
I think the confusion arises, when trying to learn to use RegEx, there seems to be different flavours which produce different results? See below:
I’d be grateful for some clarification as to how to use RegEx in DT3, asking so I know for the future when trying to build RegEx patterns in DEVONthink.
I hadn’t even noticed the $ but you should use \n.
Yes, there are different flavors of RegEx. As noted in the Help > Documentation > Appendix > Smart Rule Events and Actions, for the Scan Text and Scan Name smart rule actions, we use NSRegularExpression which conforms to ICU RegEx.
I am running into an issue of a simple RegEx rename not working. I highlight the files that I need to rename and then choose scripts - rename using RegEx pattern.
1 - Docuemnt Name - Part
1 - Docuemnt Name - Part
2 - Docuemnt Name - Part
2 - Docuemnt Name - Part
I need to rename the digit and dash at the beginning.
This thread is four years old. Please open a new one for a new problem.
And if you do so, please explain what you mean by “None … do anything”. A regex pattern like this doesn’t “do” anything, it simply matches. If you want to change the match, you must use capturing groups and refer to them with \1 etc.