Account for Ruby's multi-line regular expressions

  * Ruby uses multi-line regular expressions by default
  * Change Transform classes to match beginning and end of String
  * Add tests for Transform classes
  * More details: http://guides.rubyonrails.org/security.html#regular-expressions