Improved regex.rb