特定の文字で始まる文字列以外の文字列を削除する - Delete String without String Started by Especial Character
説明 - Explanation
# で始まる文字列以外の文字列を削除します。
Delete String without String Started by #.
別の特定の文字を指定したい場合は、以下の正規表現の # を適宜変更してください。
If you'd like to set another especial character, please replace # of the following regular expression to it.
正規表現 - Regular Expression
置換前 Before Regular Expression: ^[^#].*$ 置換後 After Regular Expression:
実行前 - Before done
# コメントなのです。 # 回答1.これはコメントだ。 Hoge.foo() # この行はコメントと言わざるを得ない。 Blar.new #=> #<Blar> Blar.new.methods.grep(/.*blar.*/) #=> ["blarblarblar"] ### # コメントと言う名の文字列だよ。
実行後 - After done
# コメントなのです。 # 回答1.これはコメントだ。 # この行はコメントと言わざるを得ない。 ### # コメントと言う名の文字列だよ。
−ω− PV.find("Po Pi Po").singer #=> "Noukaloid"