http://www.ruby-doc.org/core-2.1.2/Regexp.html

Regular expressions are assumed to use the source encoding. This can be overridden with one of the following modifiers.

/pat/u - UTF-8
/pat/e - EUC-JP
/pat/s - Windows-31J
/pat/n - ASCII-8BIT
A regexp can be matched against a string when they either share an encoding, or the regexp’s encoding is US-ASCII and the string’s encoding is ASCII-compatible.

If a match between incompatible encodings is attempted an Encoding::CompatibilityError exception is raised.

The Regexp#fixed_encoding? predicate indicates whether the regexp has a fixed encoding, that is one incompatible with ASCII. A regexp’s encoding can be explicitly fixed by supplying Regexp::FIXEDENCODING as the second argument of Regexp.new: