Input formatted String?

I want the user to be able to batch-rename objects. There are several object-dependent values (mostly integers and text) that might be used to rename the object. The user should also be able to format them (e. g. zero-pad numbers).

I tried to just let the user input a standard formatted String but that was hard to explain in the UI and I don't think it is a concept non-programming users can intuitively understand. I'm thinking about using a scripting language/expression, but I'm not sure this will work any better (Which scripting language would work best?). I also thought of using %variable% like in windows or ${variable}, but they don't allow for more complex formatting. What basically searching is an "easy to understand, powerful if needed" solution.

Objects are allowed to have the same name by the way.

Example

Think of batch-renaming files. Additional values you might use there would be:

  • The previous name of the file
  • Its size
  • Its modification date (with free-to-choose date format)
  • Its file type
  • ...