http://www.perlmonks.org?node_id=725030


in reply to Re^2: Regex exact pattern match problem!
in thread Regex exact pattern match problem!

As I mentioned above, it doesn't work (unless you really want multiple passes) if the result of the first substitution itself contains 4 consecutive 3's (for example, if the original input has 33332 consecutive 3's). Also, to save yourself some typing, you may want to look at the documentation for the string repetition operator x.

UPDATE: Thanks to johngg for pointing out that my documentation link was broken.