dogwood008の開発メモ!

最近のマイブームは機械学習, Ruby on Rails。中でも機械学習を使った金融商品の自動取引に興味があります。

2022-06-19から1日間の記事一覧

【Ruby】正規表現マッチには、^ と $ ではなく \A と \z を使おう

要旨 ^ と $ の場合 [1] pry(main)> regex = /^https:\/\/.+$/ => /^https:\/\/.+$/ [2] pry(main)> 'javascript:exploitcode() /* https://safesite.example.com */'.scan(regex) => ["https://safesite.example.com"] rubular.com \A と \z の場合 [3] pry…