in reply to Reset meaning of empty pattern?

You should accept a regex pattern as a parameter (as the variable name implies) instead of a fragment of Perl source code! This would avoid this and many other issues.