Currently S5852 assumes that a possessive quantifier in a sequence can always lead to catastrophic backtracking. However, there is an issue only when a non-possessive quantifier is followed by a possessive one, leading to backtracking and a quadratic runtime. Therefore, we should ignore previous possessive quantifiers when considering a repetition in the overlapping repetition check.
Note that this also applies to the implicit reluctant quantifier present in regexes used for partial matches.
As an example str.split("\\s*,") will cause quadratic runtime on a string consisting solely of spaces. The rule correctly identifies this. A user might be tempted to fix this by making the quantifier possessive, changing the code to str.split("\\s*+,"). This will not actually fix the problem, but it will cause us to not report the issue anymore, suggesting the fix worked when it didn't.