Match multiple entities to other entities using wildcards in automation/script trigger and action

So, the gist of my issue is the following:
I want to create a reminder system for sharpening multiple knives.

I have a date for when I sharpened a given knife latest (datetime_input.knife_1_latest) and a datetime (datetime_input.knife_1_next) that should be 90 days (or some other number of days in the future).

So, it would be simple to create an automation that would calculate and update knife_1_next based on a change in knife_1_latest.

But, I have at least 10 kitchen knives I want to keep track of and sharpen at the same interval (or at least track when they are sharpened and suggest a date in the future to sharpen them). So, I can create 10 choose/if-then automation output. But, I would much rather create one generic automation that would match knife_*WILDCARD*_latest and update knife_*SAME WILDCARD*_next.

My only issue: I don’t know how to select the relevant part of the trigger_entity_id to get the wildcard-portion nor how to code for that same wildcard in the script/automation action portion.

Is it a wild pipedream or is it possible?

Thanks in advane.