Only number files containg the same keyword

Advanced Renamer forum
#1 : 19/08-23 16:51
futile
Posts: 1
The naming convention I use for my photo gallery is:

[<keyword>].<tags>

I have multiple files that have the same keyword as well as tags and I'd like to number those in order too keep them unique so I'd like to automate that to look like:

[<keyword>]-<incr#>.<tags>

The problem I've run into is that I cant seem to find a way to to get the incrementing number tag to reset with new kewords. I'm sure there's a way to maybe script this, but I'm not the most savvy in that regard. Any insight would be appreciated.

If all else fails I could just assign a random number identifier. but I'd like to avoid that if possible.