Page 1 of 1

How to match a filename only from the beginning

PostPosted: Tue Nov 15, 2022 12:32 pm
by penguin
I'd like to match which only works if the match term is at the beginning of a filename (like in regexp: ^).

Use case: If a document is named 220816.mydocument.pdf, it should be rename to 2022-08-16.mydocument.pdf.

Unfortunately with the rule "Name matches date.filename and rename to date.filename.extension" with different date formats, documents like "Important docment draft - (220816).pdf" get renamed to 2022-08-16.).pdf.

Any ideas?

Re: How to match a filename only from the beginning

PostPosted: Wed Nov 16, 2022 10:50 am
by Mr_Noodle
If you use "matches", the pattern is anchored at the beginning and end. You need to specify a pattern which handles all characters in the name.

Re: How to match a filename only from the beginning

PostPosted: Wed Nov 16, 2022 10:52 am
by penguin
Mr_Noodle wrote:If you use "matches", the pattern is anchored at the beginning and end. You need to specify a pattern which handles all characters in the name.


It'd be helpful as a feature to match only from the beginning.

Re: How to match a filename only from the beginning

PostPosted: Wed Nov 16, 2022 10:54 am
by Mr_Noodle
Just put the "anything" token at the end then.