{"id":1267,"date":"2021-09-08T11:34:40","date_gmt":"2021-09-08T02:34:40","guid":{"rendered":"https:\/\/www.earce.biz\/?page_id=1267"},"modified":"2025-09-10T10:48:59","modified_gmt":"2025-09-10T01:48:59","slug":"tool-replace-text","status":"publish","type":"page","link":"https:\/\/www.earce.biz\/?page_id=1267","title":{"rendered":"[Tool] Occasional Text Replacements"},"content":{"rendered":"\n<p class=\"has-text-align-center wp-block-paragraph\">&lt;&lt; This service is not communicating with the server. &gt;&gt;<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Input<\/strong><\/p>\n\n\n\n<textarea id=\"textInput\" rows=\"5\" cols=\"100\" placeholder='https:\/\/www.google.com\/search?q=\u3042\u3044\u3046\u3048\u304a\n  a,\n  \"b\",\n  \\c\\,\n  \\\"d\\\",\n  \\\\e\\\\'><\/textarea>\n\n\n\n<div class=\"wp-block-button aligncenter custom-wide-button\">\n<button id=\"buttonExec1\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 10rem;\">[\\n] -> [ ]<\/button>\n<button id=\"buttonExec2\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 10rem;\">[\\n] -> [\\t]<\/button>\n<button id=\"buttonExec3\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 10rem;\">[\\t] -> [\\n]<\/button>\n<\/div>\n\n\n\n<div class=\"wp-block-button aligncenter custom-wide-button\">\n<button id=\"buttonExec4\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 16rem;\">Escape processing [&#8220;]<\/button>\n<button id=\"buttonExec5\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 16rem;\">Escape processing [\\]<\/button>\n<\/div>\n<div class=\"wp-block-button aligncenter custom-wide-button\">\n<button id=\"buttonExec6\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 16rem;\">Escape deprocessing [\\&#8221;]<\/button>\n<button id=\"buttonExec7\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 16rem;\">Escape deprocessing [\\\\]<\/button>\n\n<\/div>\n\n\n\n<div class=\"wp-block-button aligncenter custom-wide-button\">\n<button id=\"buttonExec8\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 10rem;\">encode URI<\/button>\n<button id=\"buttonExec9\" class=\"wp-block-button__link has-background has-vivid-cyan-blue-background-color\" style=\"width: 10rem;\">decode URI<\/button>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Output<\/strong><\/p>\n\n\n\n<textarea id=\"textOutput\" rows=\"10\" cols=\"100\"><\/textarea>\n\n\n\n<script type=\"text\/javascript\">\njQuery().ready(function($){\n\n$(\"#buttonExec1\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/\\n\/g, \" \");\n  }\n);\n\n$(\"#buttonExec2\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/\\n\/g, \"\\t\");\n  }\n);\n\n$(\"#buttonExec3\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/\\t\/g, \"\\n\");\n  }\n);\n\n$(\"#buttonExec4\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/(?<!\\\\)\"\/g, \"\\\\\\\"\");\n  }\n);\n\n$(\"#buttonExec5\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/(?<!\\\\\\\\)\\\\\/g, \"\\\\\\\\\");\n  }\n);\n\n$(\"#buttonExec6\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/\\\\\"\/g, '\"');\n  }\n);\n\n$(\"#buttonExec7\").click(\n  function(e) {\n    convertText($(\"#textInput\"), $(\"#textOutput\"), \/\\\\\\\\\/g, '\\\\');\n  }\n);\n\n$(\"#buttonExec8\").click(\n  function(e) {\n    var txtIn = $(\"#textInput\").val();\n    if (txtIn== \"\") {\n      txtIn= $(\"#textInput\").attr(\"placeholder\");\n    }\n    $(\"#textOutput\").val(encodeURI(txtIn));\n  }\n);\n\n$(\"#buttonExec9\").click(\n  function(e) {\n    var txtIn = $(\"#textInput\").val();\n    if (txtIn== \"\") {\n      txtIn= $(\"#textInput\").attr(\"placeholder\");\n    }\n    $(\"#textOutput\").val(decodeURI(txtIn));\n  }\n);\n\n});\n\nfunction convertText(textInput, textOutput, regText, replaceChar) {\n  var txtIn = textInput.val();\n  if (txtIn== \"\") {\n    txtIn= textInput.attr(\"placeholder\");\n  }\n\n  textOutput.val(\"\");\n  textOutput.val(txtIn.replace(regText, replaceChar));\n}\n\n\n\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;&lt; This service is not communicating with the server. &gt;&gt; Input [\\n] -> [ ] [\\n] -> [\\t] [\\t] -> [\\ &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.earce.biz\/?page_id=1267\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;[Tool] Occasional Text Replacements&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":35,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1267","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/pages\/1267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.earce.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1267"}],"version-history":[{"count":50,"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/pages\/1267\/revisions"}],"predecessor-version":[{"id":2538,"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/pages\/1267\/revisions\/2538"}],"up":[{"embeddable":true,"href":"https:\/\/www.earce.biz\/index.php?rest_route=\/wp\/v2\/pages\/35"}],"wp:attachment":[{"href":"https:\/\/www.earce.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}