{"id":502,"date":"2024-10-10T13:54:56","date_gmt":"2024-10-10T04:54:56","guid":{"rendered":"https:\/\/www.kd2.jp\/memo3\/?p=502"},"modified":"2024-10-10T13:55:10","modified_gmt":"2024-10-10T04:55:10","slug":"python%e3%80%90%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%80%91%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%81%8b%e3%82%89%e3%80%8c%e3%80%8d%e3%81%a8%e3%81%9d%e3%81%ae%e4%b8%ad%e8%ba%ab%e3%82%92%e5%89%8a","status":"publish","type":"post","link":"https:\/\/www.kd2.jp\/memo3\/?p=502","title":{"rendered":"Python:\u3010\u6b63\u898f\u8868\u73fe\u3011\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u300c()\u300d\u3068\u305d\u306e\u4e2d\u8eab\u3092\u524a\u9664\u3059\u308b\u3002"},"content":{"rendered":"<p>\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u534a\u89d2\u62ec\u5f27()\u3068\u305d\u306e\u4e2d\u8eab\u3092\u524a\u9664\u3059\u308b\u3002<br \/>\n\u534a\u89d2\u62ec\u5f27\u306b\u306f\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9\u304c\u5fc5\u8981\u3002<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;eclipse&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">import re\r\n\r\nstr = '\u5f7c\u5973\u306e\u540d\u524d\u306f\u4f50\u85e4\u82b1\u5b50(\u65e7\u59d3\uff1a\u4e0a\u7530)\u3067\u3059\u3002'\r\nchanged = re.sub('\\([^\\)]+\\)', '', str)\r\nprint(changed)<\/pre>\n<\/div>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text\/plain&quot;,&quot;theme&quot;:&quot;eclipse&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">$ python chikan_test.py\r\n\u5f7c\u5973\u306e\u540d\u524d\u306f\u4f50\u85e4\u82b1\u5b50\u3067\u3059\u3002<\/pre>\n<\/div>\n<p>\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u5168\u89d2\u62ec\u5f27()\u3068\u305d\u306e\u4e2d\u8eab\u3092\u524a\u9664\u3059\u308b\u3002<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;eclipse&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">import re\r\n\r\nstr = '\u5f7c\u5973\u306e\u540d\u524d\u306f\u4f50\u85e4\u82b1\u5b50\uff08\u65e7\u59d3\uff1a\u4e0a\u7530\uff09\u3067\u3059\u3002'\r\nchanged = re.sub('\uff08[^\uff09]+\uff09', '', str)\r\nprint(changed)<\/pre>\n<\/div>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text\/plain&quot;,&quot;theme&quot;:&quot;eclipse&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">\u5f7c\u5973\u306e\u540d\u524d\u306f\u4f50\u85e4\u82b1\u5b50\u3067\u3059\u3002<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u534a\u89d2\u62ec\u5f27()\u3068\u305d\u306e\u4e2d\u8eab\u3092\u524a\u9664\u3059\u308b\u3002 \u534a\u89d2\u62ec\u5f27\u306b\u306f\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9\u304c\u5fc5\u8981\u3002 import re str = &#8216;\u5f7c\u5973\u306e\u540d\u524d\u306f\u4f50\u85e4\u82b1\u5b50(\u65e7\u59d3\uff1a\u4e0a\u7530)\u3067\u3059\u3002&#8217; changed = re.sub(&#8216;\\([^\\)]+&hellip; <a class=\"more-link\" href=\"https:\/\/www.kd2.jp\/memo3\/?p=502\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Python:\u3010\u6b63\u898f\u8868\u73fe\u3011\u30c6\u30ad\u30b9\u30c8\u304b\u3089\u300c()\u300d\u3068\u305d\u306e\u4e2d\u8eab\u3092\u524a\u9664\u3059\u308b\u3002<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/posts\/502"}],"collection":[{"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=502"}],"version-history":[{"count":5,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions"}],"predecessor-version":[{"id":507,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions\/507"}],"wp:attachment":[{"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kd2.jp\/memo3\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}