I just noticed that ananicy-cpp already supported regular expression rules two years ago: https://gitlab.com/ananicy-cpp/ananicy-cpp/-/commit/6ea2dccceec39b6c4913f617dad81d859aa20f24
I know that ananicy-cpp didn't publish a release containing that commit yet, but considering the current maintenance level of ananicy-cpp, I don't think there will be any more releases in the future.
To use this feature, you need to turn on an extra option at compile time: -DENABLE_REGEX_SUPPORT=ON
Here's an example (regex are generated by chatgpt)
{ "name": "", "name_regex": "^(?=.*steamapps).+.exe(?:[ \t]|$)", "type": "Game" }
(You have to add name in front of it, otherwise ananicy-cpp won't recognise the rule)
This rule will match all programs that are executed with a path containing steamapps and ending with .exe