in reply to RegExp and hidden (not printable) characters.
Dump the content of scalar variables/expressions that you want to match against with Devel::Peek, this will reveal what you call "hidden" characters.