by shigemk2

当面は技術的なことしか書かない

2013-06-13から1日間の記事一覧

後方参照

後方参照は$&を使う # -*- coding: utf-8 -*- hoge = '0123-4' p /(-\d)/ =~ hoge print($& + "\n") マッチした文字列を取得($&) - 後方参照 - Ruby正規表現の使い方

97 Things Every Programmer Should Know 94 Small Functions Using Examples

WE WOULD LIKE TO WRITE CODE THAT IS CORRECT, and have evidence on hand that it is correct. It can help with both issues to think about the "size" of a function. One way to find out what those types should be is to find the examples to chec…