diff --git a/ChangeLog b/ChangeLog index 8e203c1318..4f1be40e19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 25 10:34:15 2014 Zachary Scott + + * doc/regexp.rdoc: [DOC] Clarify whitespace matching by @allolex + [Fixes GH-606] https://github.com/ruby/ruby/pull/606 + Sun May 25 10:19:34 2014 Zachary Scott * enum.c: [DOC] Use #find in example to clarify alias by @rachellogie diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index 29435a96d7..810f15ce1a 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -558,8 +558,11 @@ A contrived pattern to match a number with optional decimal places: \Z/x float_pat.match('3.14') #=> # -*Note*: To match whitespace in an x pattern use an escape such as -\s or \p{Space}. +There are a number of strategies for matching whitespace: + +* Use a pattern such as \s or \p{Space}. +* Use escaped whitespace such as \ , i.e. a space preceded by a backslash. +* Use a character class such as [ ]. Comments can be included in a non-x pattern with the (?#comment) construct, where comment is