irb(main):001:0> "\r\n\n".gsub(/\r\n/, "\n")
=> "\n\n"
irb(main):002:0> "\r\n\n".gsub(/\R/, "\n")
=> "\n\n"
正規表現 (Ruby 2.5.0) https://docs.ruby-lang.org/ja/latest/doc/spec=2fregexp.html
Go to list of users who liked
More than 5 years have passed since last update.
irb(main):001:0> "\r\n\n".gsub(/\r\n/, "\n")
=> "\n\n"
irb(main):002:0> "\r\n\n".gsub(/\R/, "\n")
=> "\n\n"
正規表現 (Ruby 2.5.0) https://docs.ruby-lang.org/ja/latest/doc/spec=2fregexp.html
Register as a new user and use Qiita more conveniently
Go to list of users who liked