Conversion with encodings and monkey patch

Convert the regexp properly and get rid of Exception raised when invoking `non_empty?`
with the `'.'.encode` method call with the monkey patch