in reply to Re^2: Simple pattern match failing - Possibly unicode issue
in thread Simple pattern match failing - Possibly unicode issue

/.{2}/ will match two characters. Which may be 4 bytes, or even more. But there's no 2 character UTF-8 byte sequence which, when interpreted as non-UTF-8, will result in a string of 4 ASCII digits.

And yes, the code having the problem isn't the code I posted. But I can assure you the code having the problem is doing the same thing.
Ehm, if it's doing the same thing, you wouldn't be having the problem you're encountering. You cannot have two pieces of code "doing the same thing" when one has a problem, and the other doesn't. If they do the same thing, they output the same thing.
I have anecdotal evidence that perl's unicode implementation have a role to play in this. I removed:
use utf8;
That "directive" tells perl your source code is encoded in UTF-8. Since the code fragment you showed contains ASCII only, the use of this pragma is neither wrong, nor necessary.

I'd really like to see the code that you claim to exhibit the behaviour you describe. You have stumbled upon an (unknown) bug.