Update regex.rb

Add UTF8 encoding mark for Ruby <2.0 compatibility.