in reply to Why is Perl suddenly slow in THIS case?
\d+R specifies 0 or more digits followed by an R, so when the string is 42,000 R's it matches, triggering next, and the loop continues. Since there are 42,000 R's next is signaled 42,000 times in the loop before it runs out of characters to test. When the string is 42,000 Q's that first test does not match, it falls thru, and since there is no whitespace the loop terminates
ok, nevermind, i didnt get anypart right did i, \d+ is 1 or more, and \w is a word char not whitespace.
|
|---|