fixed issue with non-unicode regular expressions

this was making the matches return normal strings instead of unicode,
leading to issues with non-ascii characters in filenames