{"id":862,"date":"2018-08-21T17:08:22","date_gmt":"2018-08-21T08:08:22","guid":{"rendered":"https:\/\/python-introduction.com\/?p=862"},"modified":"2018-08-21T17:08:22","modified_gmt":"2018-08-21T08:08:22","slug":"%e3%80%90python%e3%80%91%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e7%bd%ae%e6%8f%9b%e3%81%88%e3%82%8b%e6%96%b9%e6%b3%95%e3%81%be","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=862","title":{"rendered":"\u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3048\u308b\u65b9\u6cd5\u307e\u3068\u3081"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u304d\u63db\u3048\u305f\u308a<br \/>\n\u524a\u9664\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u6587\u5b57\u5217\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u65b9\u306f<br \/>\n\u5148\u306b\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u21d2<a href=\"https:\/\/python-introduction.com\/?p=213\" target=\"blank\">python\u7279\u6709\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u307e\u3068\u3081<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=174\" target=\"blank\">\u3010python\u3011print\u3067\u6587\u5b57\u5217\u3092\u6539\u884c\u3059\u308b\u65b9\u6cd5\u3068\u6539\u884c\u3057\u306a\u3044\u65b9\u6cd5<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=296\" target=\"blank\">\u3010python\u5165\u9580\u3011\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u305f\u308a\u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=481\" target=\"blank\">\u3010Python\u3011\u7c21\u5358\u306b\u6587\u5b57\u5217\u3092\u691c\u7d22\u3059\u308b3\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u7f6e\u63db\u306b\u3064\u3044\u3066\u89e3\u8aac<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=581\" target=\"blank\">\u3010Python\u3011\u6587\u5b57\u5217\u3092\u7d50\u5408\u30fb\u62bd\u51fa\u3057\u305f\u308a\u7e70\u308a\u8fd4\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=837\" target=\"blank\">\u3010Python\u3011\u6587\u5b57\u5217\u3092\u524a\u9664\u30fb\u9577\u3055\u3092\u8abf\u3079\u308b\u30fb\u6570\u5024\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#Python-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#Python1\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u524a\u9664\u3059\u308b\u65b9\u6cd5\u5fdc\u7528\u7de81<\/a><\/li><li><a href=\"#Python2\"><span class=\"toc_number toc_depth_1\">4<\/span> \u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u524a\u9664\u3059\u308b\u65b9\u6cd5\u5fdc\u7528\u7de82<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Python\">\u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikaruotoko819.jpg\" alt=\"\u6587\u5b57\u5217\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\" width=\"617\" height=\"427\" class=\"alignnone size-full wp-image-840\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikaruotoko819.jpg 617w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikaruotoko819-300x208.jpg 300w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/p>\n<p>\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u3068\u6587\u5b57\u5217\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u306f<br \/>\n\u6b63\u898f\u8868\u73fe\u306e\u5834\u5408\u3001\u307b\u3068\u3093\u3069\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u3069\u3061\u3089\u304b\u3068\u3044\u3046\u3068<br \/>\n\u6587\u5b57\u5217\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u306e\u65b9\u304c\u3001<br \/>\n\u7c21\u5358\u3060\u3068\u500b\u4eba\u7684\u306b\u306f\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u307e\u305a\u306f\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u304b\u3089<br \/>\n\u5165\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u4f8b\u984c1\u3092\u4e00\u7dd2\u306b\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\uff08\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u524a\u9664\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)\r\nprint(x)<\/pre>\n<p>\u4f8b\u984c1\u3067\u306f\u307e\u305a<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import re<\/pre>\n<p>\u304b\u3089\u59cb\u307e\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>import re\u3068\u66f8\u304f\u3053\u3068\u306b\u3088\u3063\u3066<br \/>\n\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u305f\u8868\u73fe\u3092\u3053\u308c\u304b\u3089\u59cb\u3081\u3066\u3044\u304f\u3053\u3068\u3092<br \/>\nPython\u306b\u4f1d\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u611f\u899a\u3067\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'<\/pre>\n<p>\u3053\u3053\u306f\u300e\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002\u300f<br \/>\n\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u5909\u6570x\u306b\u4ee3\u5165\u3057\u305f\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u4ee3\u5165\u306b\u3064\u3044\u3066\u306f\u30b3\u30c1\u30e9\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u3067\u3001\u3053\u3053\u304c\u6b63\u898f\u8868\u73fe\u306e\u30ad\u30e2\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)\r\nprint(x)<\/pre>\n<p>\u4e2d\u3067\u3082\u3053\u3053\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)<\/pre>\n<p>re.sub()\u3092\u4f7f\u3046\u3053\u3068\u3067\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u3053\u308c\u306f\u300e\u30d6\u30eb\u30d6\u30eb\u300f\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u524a\u9664\u3057\u306a\u3055\u3044\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">re.sub('\u524a\u9664\u3057\u305f\u308a\u7f6e\u63db\u3057\u305f\u3044\u5143\u306e\u6587\u5b57\u5217', '\u524a\u9664\u3059\u308b\u306a\u3089\u7121\u8a18\u5165\u3067\u7f6e\u63db\u3059\u308b\u306a\u3089\u6587\u5b57\u5217', \u72d9\u3063\u305f\u5909\u6570)<\/pre>\n<p>\u3068\u3044\u3046\u5f0f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<br \/>\nprint(x)\u306b\u3088\u3063\u3066\u5909\u6570x\u306e\u4e2d\u8eab\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001<br \/>\n\u300e\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u9707\u3048\u3066\u3044\u305f\u3002\u300f<br \/>\n\u3068\u306a\u308a\u3001\u898b\u4e8b\u306b\u300e\u30d6\u30eb\u30d6\u30eb\u300f\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u524a\u9664\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikihyougennn820.jpg\" alt=\"\u6b63\u898f\u8868\u73fe \u6587\u5b57\u5217\u306e\u524a\u9664\" width=\"407\" height=\"184\" class=\"alignnone size-full wp-image-866\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikihyougennn820.jpg 407w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikihyougennn820-300x136.jpg 300w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/p>\n<h2><span id=\"Python-2\">\u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/iratukujosei820.jpg\" alt=\"\u6b63\u898f\u8868\u73fe \u6587\u5b57\u5217 \u7f6e\u63db\" width=\"620\" height=\"415\" class=\"alignnone size-full wp-image-867\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/iratukujosei820.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/iratukujosei820-300x201.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u7d9a\u3044\u3066\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u5148\u307b\u3069\u306e\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u3068<br \/>\n\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u306f\u307b\u3068\u3093\u3069\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u7c21\u5358\u306b\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\uff08\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('\u30d6\u30eb\u30d6\u30eb', '\u30ac\u30bf\u30ac\u30bf', x)\r\nprint(x)<\/pre>\n<p>\u4f8b\u984c2\u3067\u306f\u30d6\u30eb\u30d6\u30eb\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u30ac\u30bf\u30ac\u30bf\u306b<br \/>\n\u7f6e\u63db\u3057\u305f\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u304c\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('\u30d6\u30eb\u30d6\u30eb', '\u30ac\u30bf\u30ac\u30bf', x)<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u300e\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30ac\u30bf\u30ac\u30bf\u9707\u3048\u3066\u3044\u305f\u3002\u300f<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/gatagata820.jpg\" alt=\"\u6587\u5b57\u5217\u7f6e\u63db\" width=\"413\" height=\"183\" class=\"alignnone size-full wp-image-870\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/gatagata820.jpg 413w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/gatagata820-300x133.jpg 300w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/p>\n<p>\u6b21\u3001\u7406\u89e3\u3092\u6df1\u3081\u308b\u305f\u3081\u306b<br \/>\n\u3082\u3046\u4e00\u3064\u4f8b\u984c\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u300e\u30ed\u30b7\u30a2\u300f\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u300e\u5357\u6975\u300f<br \/>\n\u3068\u3044\u3046\u6587\u5b57\u5217\u306b\u7f6e\u63db\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c3\uff08\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('\u30ed\u30b7\u30a2', '\u5357\u6975', x)\r\nprint(x)<\/pre>\n<p>\u4f8b\u984c3\u3092\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u78ba\u304b\u306b\u300e\u7f8e\u5973\u304c\u5357\u6975\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002\u300f\u3068\u306a\u308a<br \/>\n\u30ed\u30b7\u30a2\u304c\u5357\u6975\u306b\u7f6e\u63db\u3055\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<h2><span id=\"Python1\">\u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u524a\u9664\u3059\u308b\u65b9\u6cd5\u5fdc\u7528\u7de81<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bijoiakai820.jpg\" alt=\"\u6b63\u898f\u8868\u73fe\u5fdc\u7528\u7de8\" width=\"620\" height=\"455\" class=\"alignnone size-full wp-image-871\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bijoiakai820.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bijoiakai820-300x220.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\u5b66\u3093\u3067\u304d\u305f\u6b63\u898f\u8868\u73fe\u306e\u77e5\u8b58\u3092<br \/>\n\u3055\u3089\u306b\u767a\u5c55\u3055\u305b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c4\uff08[]\u3067\u56f2\u3081\u3070\u8907\u6570\u306e\u6587\u5b57\u5217\u3092\u4e00\u5ea6\u306b\u524a\u9664\u3067\u304d\u308b\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('[\u30ed\u30b7\u30a2\u306e\u30d6\u30eb\u30d6\u30eb\u4e2d]', '', x)\r\nprint(x)<\/pre>\n<p>\u4f8b\u984c4\u306f\u4f8b\u984c1\u306e\u767a\u5c55\u5f62\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u984c1\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\uff08\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u524a\u9664\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)\r\nprint(x)<\/pre>\n<p>\u3067\u3057\u305f\u306d\u3002<\/p>\n<p>\u4f8b\u984c1\u3068\u4f8b\u984c4\u306e\u9055\u3044\u306f<\/p>\n<p>\u4f8b\u984c4\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('[\u30ed\u30b7\u30a2\u306e\u30d6\u30eb\u30d6\u30eb\u4e2d]', '', x)<\/pre>\n<p>\u3067\u3059\u304c<\/p>\n<p>\u4f8b\u984c1\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('\u30d6\u30eb\u30d6\u30eb', '', x)<\/pre>\n<p>\u3067\u3059\u3002<br \/>\n&#8216;[\u30ed\u30b7\u30a2\u306e\u30d6\u30eb\u30d6\u30eb\u4e2d]&#8217;\u3068\u3053\u3093\u306a\u6587\u5b57\u5217\u3067\u3042\u3063\u3066\u3082<br \/>\n[]\u3067\u56f2\u3080\u3053\u3068\u3067\u3001\u5909\u6570x\u306b\u5165\u3063\u305f\u6587\u5b57\u5217\u306b\u8a72\u5f53\u3059\u308b\u3082\u306e\u304c\u3042\u308c\u3070<br \/>\n\u4e00\u6c17\u306b\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('[\u30ed\u30b7\u30a2\u306e\u30d6\u30eb\u30d6\u30eb\u4e2d]', '', x)<\/pre>\n<p>\u306b\u3088\u3063\u3066\u3001\u9ec4\u8272\u306e\u3068\u3053\u308d\u3060\u3051\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002<br \/>\nx = &#8216;\u7f8e\u5973\u304c<span class=\"yellowbg\">\u30ed\u30b7\u30a2\u306e<\/span>\u6975\u5bd2\u5730\u7344<span class=\"yellowbg\">\u306e\u4e2d<\/span>\u3067<span class=\"yellowbg\">\u30d6\u30eb\u30d6\u30eb<\/span>\u9707\u3048\u3066\u3044\u305f\u3002&#8217;<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001<br \/>\n\u300e\u7f8e\u5973\u304c\u6975\u5bd2\u5730\u7344\u3067\u9707\u3048\u3066\u3044\u305f\u3002\u300f<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/sakujoss820.jpg\" alt=\"\u524a\u9664\" width=\"430\" height=\"188\" class=\"alignnone size-full wp-image-873\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/sakujoss820.jpg 430w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/sakujoss820-300x131.jpg 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u524a\u9664\u3057\u305f\u3044\u6587\u5b57\u5217\u3092[]\u3067\u56f2\u3080\u3053\u3068\u3067<br \/>\n\u9023\u7d9a\u3057\u305f\u6587\u5b57\u5217\u3067\u306a\u304f\u3066\u3082\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2><span id=\"Python2\">\u3010Python\u3011\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u63db\u524a\u9664\u3059\u308b\u65b9\u6cd5\u5fdc\u7528\u7de82<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonhai816.jpg\" alt=\"\u6b63\u898f\u8868\u73fe\" width=\"620\" height=\"414\" class=\"alignnone size-full wp-image-754\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonhai816.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonhai816-300x200.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u3055\u3063\u305d\u304f\u4f8b\u984c5\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c5\uff08^\u3092\u4f7f\u3046\u3053\u3068\u3067\u56f2\u3063\u305f\u6587\u5b57\u3092\u6b8b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\uff09\r\n\r\nimport re\r\n\r\nx = '\u7f8e\u5973\u304c\u30ed\u30b7\u30a2\u306e\u6975\u5bd2\u5730\u7344\u306e\u4e2d\u3067\u30d6\u30eb\u30d6\u30eb\u9707\u3048\u3066\u3044\u305f\u3002'\r\n\r\nx = re.sub('[^\u30d6\u30eb\u30d6\u30eb\u304c\u7f8e\u5973\u304c\u3002]', '', x)\r\nprint(x)<\/pre>\n<p>\u5927\u4e8b\u306a\u306e\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = re.sub('[^\u30d6\u30eb\u30d6\u30eb\u304c\u7f8e\u5973\u304c\u3002]', '', x)<\/pre>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u521d\u767b\u5834\u306f\u300e^\u300f\u306e\u90e8\u5206\u3067\u3059\u3002<br \/>\nx = re.sub(&#8216;[<span class=\"yellowbg\">^<\/span>\u30d6\u30eb\u30d6\u30eb\u304c\u7f8e\u5973\u304c\u3002]&#8217;, &#8221;, x)<br \/>\n\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u5426\u5b9a\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>x = re.sub(&#8216;[\u30d6\u30eb\u30d6\u30eb\u304c\u7f8e\u5973\u304c\u3002]&#8217;, &#8221;, x)<br \/>\n\u3068\u300e^\u300f\u304c\u306a\u3044\u3068\u3001\u300e\u30d6\u30eb\u30d6\u30eb\u300f\u300e\u304c\u300e\u7f8e\u5973\u300f\u300e\u3002\u300f<br \/>\n\u3068\u3044\u3063\u305f\u6587\u5b57\u5217\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u3059\u304c\u3001\u300e^\u300f\u306b\u3088\u3063\u3066<br \/>\n\u300e\u30d6\u30eb\u30d6\u30eb\u300f\u300e\u304c\u300e\u7f8e\u5973\u300f\u300e\u3002\u300f<span class=\"redb18\">\u4ee5\u5916\u306e<\/span>\u6587\u5b57\u5217\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u300e\u7f8e\u5973\u304c\u30d6\u30eb\u30d6\u30eb\u3002\u300f<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikisakujoosi820.jpg\" alt=\"\u6b63\u898f\u8868\u73fe\u3000\u524a\u9664\" width=\"408\" height=\"183\" class=\"alignnone size-full wp-image-875\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikisakujoosi820.jpg 408w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/seikisakujoosi820-300x135.jpg 300w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/p>\n<p>\u4ee5\u4e0a\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u524a\u9664\u3057\u305f\u308a<br \/>\n\u7f6e\u63db\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u7f6e\u304d\u63db\u3048\u305f\u308a \u524a\u9664\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002 \u6587\u5b57\u5217\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u65b9\u306f \u5148\u306b\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u21d2python\u7279\u6709\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u307e\u3068\u3081 \u21d2\u3010pytho [&hellip;]","protected":false},"author":1,"featured_media":853,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,73],"tags":[3,74,38],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/862"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=862"}],"version-history":[{"count":8,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":878,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions\/878"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/853"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}