Everything I stated was correct, but the mixup is that you think I was taking into account your code, while I wasn't. I only saw his regex and the explanation of the parameters, including what {3,3} does, which is the basis of my post. Note how my code examples strictly centered around showing how {N,N} really works, not necessarily a regex to apply to whatever situation you need it in. I don't even know what your code does, as I only skimmed this thread.

Many people using regex are tricked when they assume that {N,N} will mean the regex will fail to match cases where there are more than N consecutive occurences. I don't even know if g_at_work knew it already, but if he did, it still contains some good info for other people, as it's an extremely common pitfall for people relatively new at regex.


Gone.