以下の内容はhttps://tbpgr.hatenablog.com/entry/20141130/1417327968より取得しました。


Ruby | Regexp | source

概要

Regexp#source -> String

詳細

その正規表現のもととなった文字列表現を生成して返却。

サンプルコード
require 'tbpgr_utils'

bulk_puts_eval binding, <<-EOS
/h.ge/i.source
/h.ge/im.source
//.source
EOS

__END__
下記はTbpgrUtils gemの機能
bulk_puts_eval

https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils

出力

/h.ge/i.source  # => "h.ge"
/h.ge/im.source # => "h.ge"
//.source       # => ""



以上の内容はhttps://tbpgr.hatenablog.com/entry/20141130/1417327968より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14