Influence of matching rules caused by wildcard different positions in D+ rules

Hi guys ,I am a newcomer and I have some question about the influence of matching rules speed and performance caused by wildcard different positions in D+ rules
Please help me thx :azn:
Matching algorithm is how to achieve
For example
Protected RD 1 *\System\CurrentControlSet\Control\SafeBoot\AlternateShell
Protected RD 2 HKLM\System\CurrentControlSet\Control\SafeBoot\AlternateShell

Then someone have to modify the registry behavior like

I guess
Assume that for a second rule,Left to right manner using matches,HKLM match from the beginning has been found not to B decides not to match this rule.
While the first,If comodo finds rule header contains the wildcard ‘’ ,while the tail does not.Comodo decided to use right-to-left way to match,So start matching B is not right.Comodo decided not to match this rule (of course, left to right, right to left match official is I guess, maybe there are more intelligent matching algorithm)
I think this is the first more than the second high efficiency.
Spend time in the match and resource intensive
I think form like it : Speed * A=B * >
C *
Resource consumption * A=B * <* C *
But the above is that I guess, I need to the Great God give me the answer
How to write in the registry enables comodo matching rules to play the fastest speed and occupies minimum resource

Like AB

AB This is how to match left to right?Right to left?Or other

Way matching process should be the same way???
I really really really need help !
Thanks very much!

In other words, how do I write protected project can make comodo can quickly match Modified target in windows