2010-02-14から1日間の記事一覧
String#replaceの第二引数に関数を入れると加工して返せる string.replace(reg, function replacer(str, p1, p2, p3....., offset, s) { }); str: regにマッチした部分文字列 p1, p2, p3........: strがRexExpオブジェクトの場合の()のマッチ結果 offset: マ…
String#replaceの第二引数に関数を入れると加工して返せる string.replace(reg, function replacer(str, p1, p2, p3....., offset, s) { }); str: regにマッチした部分文字列 p1, p2, p3........: strがRexExpオブジェクトの場合の()のマッチ結果 offset: マ…