Issue #2054 has been updated by Yui NARUSE.
+ * literally backslash-escape that: <tt>\\\\\\</tt>.
Why 6 times?
+ * * <tt>/\d/</tt> - A digit character (<tt>[0-9]</tt>)
+ * * <tt>/\D/</tt> - A non-digit character (<tt>[^0-9]</tt>)
Add following:
* * <tt>/\h/</tt> - A hexdigit character (<tt>[0-9a-fA-F]</tt>)
* * <tt>/\H/</tt> - A non-hexdigit character (<tt>[^0-9a-fA-F]</tt>)
+ * * <tt>{n,}</tt> - n or more times
Add * * <tt>{,m}</tt> - m or less times
== Grouping
(?: ..) should be introduced also in this chapter.
+ * Capture groups can be referred to by name when defined with the
+ * <tt>(?<name>)</tt> construct.
Don't mention an alias (?'name'subexp) ?
+ * /£(?<pounds>\d+)\.(?<pence>\d+)/.match("£3.67")
Pound Sign (U+00A3) is non-ASCII.
Dollar Sign (U+0024) is in ASCII (but Cent Sign is non-ASCII).
+ * characters match <i>pat</i>, but doesn¡Çt include those characters in the
Right Single Quotation Mark (U+2019) is non-ASCII
Apostrophe (U+0027) is in ASCII.
+ * A regexp can be matched only against a string whose encoding is the
+ * same as, or a superset of, the regexp's encoding. If a match between
The word "superset" is misleading.
In Ruby 1.9, this relation is only US-ASCII and other ASCII-compatible encodings.
So "or regexp's encoding is US-ASCII and string's encoding is ASCII-compatible".
+ * The <tt>Regexp#fixed_encoding?</tt> predicate indicates whether the regexp
Needs encoding modifiers set FIXED_ENCODING.
And /n doesn't set FIXED_ENCODING but warn.
irb(main):001:0> /a/n=~"a\u3042"
(irb):1: warning: regexp match /.../n against to UTF-8 string
=> 0
Don't mention following?
* x-y range from x to y
* ..&&.. intersection (low precedence at the next of ^)
* reluctant and possessive quantifier
* atomic group (?>subexp)
* back reference \k<..>
* subexp call \g<..>
* substitution by literarl regexp matching
/(?<foo>b\w+)/ =~ 'bar' #=> 0
foo #=> "bar"
If you can describe about /(a|b+)*/ , it will be helpful.
http://www.ruby-forum.com/topic/70726
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2054
----------------------------------------
http://redmine.ruby-lang.org