The spaces are there to split the target string into three parts, before the '*', the star part, and after the star. This prevents trying to match with a pattern equivalent to /a*a*/ which causes the long matching time you were seeing;
In reply to Re^5: the case where regex seems to work slower
by tybalt89
in thread the case where regex seems to work slower
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |