{"height":"190","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","title":"\u6b63\u898f\u8868\u73fe\u3092\u5229\u7528\u3057\u3066\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3057\u3066\u307f\u305f","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.shigemk2.com%2Fentry%2F20130615%2F1371266456\" title=\"\u6b63\u898f\u8868\u73fe\u3092\u5229\u7528\u3057\u3066\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3057\u3066\u307f\u305f - by shigemk2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2013-06-15 12:20:56","image_url":null,"description":"\u6b63\u898f\u8868\u73fe\u3067\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3057\u3066\u307f\u305f # -*- coding: utf-8 -*- hoge = '99999999-1000' /(-\\d*)/ =~ hoge tekitou = $&.to_i - 1 hoge.gsub!($&, tekitou.to_s) print(hoge) # 99999999-1001 $&\u304c\u6587\u5b57\u5217\u306a\u306e\u3067\u3001to_i\u3057\u3066\u8a08\u7b97\u3057\u3066\u3001 gsub\u3057\u305f\u3044\u306e\u3067to_s\u3059\u308b\u3068\u3044\u3046\u8b0e\u51e6\u7406\u3092\u3084\u3063\u3066\u3044\u305f\u3002\u305f\u3060\u306e\u7fd2\u4f5c\u3067\u3001\u3053\u308c\u3092\u5143\u624b\u306b\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u3002","author_url":"https://blog.hatena.ne.jp/shigemk2/","author_name":"shigemk2","categories":["Ruby"],"width":"100%","blog_title":"by shigemk2","type":"rich","blog_url":"https://www.shigemk2.com/","url":"https://www.shigemk2.com/entry/20130615/1371266456"}