Hello,
having read your posting, two possible error sources came to my mind. It is possible that your problem is caused by the fact that you didn't use the correct regular pattern but it may also be that you didn't correctly take the database encoding into account. At any rate, I hope that I will be able to quickly isolate and solve the problem.
I should mention that I have more than ten years of programming experience with Perl.