Rename with RegEx problem

H, I have filenames like this

Kontoauszug_103_Nr_2019_001_per_2019_05_29

What I’d like to achive is a filename like this

Kontoauszug_103 01/19 2019_05_29

(basically: shorten the year to the two last digits, move the month in front of it and use “/” as a separator instead of _)

I try the RegEx

_20([0-9][0-9])_00([0-9])_per_

with the replacement pattern (with a leading and a trailing blank)

0\2/\1

The script (or rather sed) no complains “bad flag in substitute command ‘0’”
Any ideas what might be the problem here?

Ab der nächsten Version wird dies auch mit intelligenten Regeln oder Stapelverarbeitung, d.h. ohne Skripte, möglich sein:

1 Like

Jehova. Wieder mit dem Umweg über sed oder mit integrierten RegExen?

Das wird vollständig integriert sein. Obiges Beispiel akzeptiert sed z.B. nicht (warum auch immer), liefert aber die gewünschten Ergebnisse.

1 Like

Wird es dieses “scannen” für einen Regulären Ausdruck auch für andere Teile eines Dokuments geben, z.b. den Inhalt? Das wäre cool ™

Sie müssen einfach abwarten und sehen! :wink:

(Übersetzt mit https://deepl.com)

Thanks for this equally cool answer. And keep using DeepL, its translations are usually way better than Google’s.

And keep using DeepL, its translations are usually way better than Google’s.

Glad to hear it! My native German coworkers have also vouched for DeepL’s quality too :slight_smile:

I’m a brand new user of version 3.5 and happily playing around with the new regex feature. What flavour does DNtp use, or is there any documentation?

I’ve been trying a couple of expressions that would match in Regex101 in all flavours, but do not in DNtp, such as /(medical)? ?(invoice)/. Also, I’d love to use \L for lower case transformation together with the backreference, such as \L\1.

Are these things possible?

DEVONthink uses Cocoa’s support for regular expressions which uses ICU.