Ruby's regex literal can take the options i
, m
, x
, which are documented. But besides them, it can accept much wider variety of options. Here is the inventory of the options that seem to be allowed:
//e # => //
//i # => //i ignore case
//m # => //m multiline
//n # => //n
//o # => //
//s # => //
//u # => //
//x # => //x extended
- What do they do? Are some of them related to encoding? What about others?
- If they indicate encoding, then what happens when more than one encoding is specified?
- While other options raise an unknown regex options error, the ones listed here do not. If the answer to the previous question is that they do nothing, then why are these particular options allowed?
- Why is
n
reflected in the inspection while others are not? Do the ones whose inspection do not show difference, actually differ?
If there is a documentation, link to that would be appreciated.