{"published":"2008-07-07 23:18:35","categories":["Java","\u30e1\u30e2"],"height":"190","blog_title":"\u30d1\u30f3\u30d7\u30ad\u30f3\u30b9\u30d1\u30a4\u30b9\u30e9\u30c6","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpumpkin.hatenablog.jp%2Fentry%2F20080707%2F1215440315\" title=\"\u6b63\u898f\u8868\u73fe\u3067Replace\u3059\u308b - \u30d1\u30f3\u30d7\u30ad\u30f3\u30b9\u30d1\u30a4\u30b9\u30e9\u30c6\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://pumpkin.hatenablog.jp/entry/20080707/1215440315","title":"\u6b63\u898f\u8868\u73fe\u3067Replace\u3059\u308b","author_name":"takeru-c","version":"1.0","author_url":"https://blog.hatena.ne.jp/takeru-c/","type":"rich","image_url":"http://ecx.images-amazon.com/images/I/51RMcN2pynL.jpg","provider_url":"https://hatena.blog","blog_url":"https://pumpkin.hatenablog.jp/","provider_name":"Hatena Blog","description":"\u6700\u8fd1Java\u3092\u89e6\u3063\u3066\u308b\u3088\u3002\u5916\u6ce8\u5148\u306eJava\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u4f5c\u3063\u305f\u30bd\u30fc\u30b9\u3092\u6539\u826f\u3057\u3066\u307e\u3059\u3002\u3084\u3070\u3044Java\u9762\u767d\u3044\u3002eclipse\uff0bJava\u3063\u3066\u3059\u3052\u3047\u3002\u3082\u3063\u3068Java\u306b\u3064\u3044\u3066\u5b66\u3073\u305f\u3044\uff1e\uff1c \u3068\u3044\u3046\u308f\u3051\u3067\u81ea\u5206\u30e1\u30e2\u3002 import java.util.regex.*; Pattern pattern = Pattern.compile(\"(hoge)\"); Matcher matcher = pattern.matcher('hoge piyo'); String s = matcher.replaceFirst(\"piyo\"); if(matcher.group(1) != null){ s = matche\u2026"}