I found this regular expression in an old system i’m working on.
(\s*)*
I’m pretty sure the extra ” * ” at the end is redundant but I want to make sure is not doing anything before I remove it.
It’s causing a performance issue when it’s used in the regex.matches() method to the point that hangs the entire system if the string used as a parameter has 25+ spaces
Does anybody knows if that particular syntax has a special functionality?
Ps: Its a pretty huge system so I can’t test every posible scenario
Assuming the inner
*is greedy, then, yes, I think the outer one is redundant. The outer*attempts to repeat the sub-match, but there would only ever be one instance of the sub-match because it’s greedy.