< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #8714 has been updated by phluid61 (Matthew Kerwin).
Eregon (Benoit Daloze) wrote:
> Why not Regexp.new('simple quoted string or any literal not interpolating')?
That would have to be Regexp.new(%q/.../) to avoid having to escape single quotes and double-escape backslashes in the string literal.. which is pretty obtuse.
> Also,
> /[$#]/ # => /[$#]/ and
> "[#$]" => "[\#$]" are fine on 2.0 and later.
>
> (Although "[#$]".inspect should probably not escape '#' but it is harmless)
Off the top of my head, I can't think of how to construct a regexp literal to match a hash character at the end of the string (i.e. /#$/), without first constructing a string.
----------------------------------------
Feature #8714: Non-interpolated regular expression literal
https://bugs.ruby-lang.org/issues/8714#change-40779
Author: phluid61 (Matthew Kerwin)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version:
=begin
I propose a new %string for non-interpolated regexp literals: %R
It is common to see erroneous bug reports around the use of ((%#%)) in regexp literals, for example where (({/[$#]/})) raises a syntax error "unexpected $undefined", and this confuses people. The only solution is to rearrange the regular expression (such as (({/[$#]/}))), which is not always desirable.
An non-interpolated regexp, such as (({%R/[$#]/})), would allow a much simpler resolution.
=== Known Issues
* the capitalisation is the opposite of %Q(interpolated) and %q(uninterpolated)
* %R was also proposed for literal Rationals in #8430, although I believe this has been superseded by the (({1.2r})) syntax
=end
--
http://bugs.ruby-lang.org/