зеркало из https://github.com/github/ruby.git
[DOC] \s in regexp is not same as in string [ci skip]
This commit is contained in:
Родитель
782d1b8fb0
Коммит
f8b3d7d159
|
@ -69,7 +69,8 @@ a backslash literally, backslash-escape it: <tt>\\\\</tt>.
|
|||
/a\\\\b/.match('a\\\\b') #=> #<MatchData "a\\b">
|
||||
|
||||
Patterns behave like double-quoted strings so can contain the same
|
||||
backslash escapes.
|
||||
backslash escapes (the meaning of <tt>\s</tt> is different a little however,
|
||||
see bellow[#label-Character+Classes]).
|
||||
|
||||
/\s\u{6771 4eac 90fd}/.match("Go to 東京都")
|
||||
#=> #<MatchData " 東京都">
|
||||
|
|
Загрузка…
Ссылка в новой задаче