In this example, the rule is matching ABC, and as soon as it has that match from the first case it returns "True".
If you want it to match "ABC" exactly, and not bring in the "ABCDEF" account, try adding a dollar sign to the end, as in: ([Aa][Bb][Cc])$
The $ indicates end of line, so nothing can come after [Cc]. This will cause the rule to only match an account with the exact name ABC.