Regular Expression
Modifiers // from Tutorial
Point
http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm
"Regular
expression
literals
may
include
an optional modifier to control various
aspects of matching. The modifier is specified after the second slash
character . . . and may be represented by one of these characters:"
"
| Modifier |
Description |
| i |
Ignore
case
when
matching
text. |
| o |
Perform
#{}
interpolations
only
once,
the first time the regexp literal is
evaluated. |
| x |
Ignores
whitespace
and
allows
comments
in regular expressions |
| m |
Matches
multiple
lines,
recognizing
newlines
as normal characters |
| u,e,s,n |
Interpret
the
regexp
as
Unicode
(UTF-8), EUC,
SJIS, or ASCII. If none of these modifiers is specified, the regular
expression is assumed to use the source encoding. |
"
"Like string literals delimited with %Q, Ruby allows you to begin
your regular expressions with %r followed by a delimiter of your
choice. This is useful when the pattern you are describing contains a
lot of forward slash characters that you don't want to escape:"
|