{"id":107,"date":"2008-11-28T00:00:09","date_gmt":"2008-11-28T07:00:09","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=244"},"modified":"2008-11-28T00:00:09","modified_gmt":"2008-11-28T07:00:09","slug":"string-replace-regexp","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=107","title":{"rendered":"String.replace()"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar words:String = &quot;ActionSnippet.com is a website. ActionSnippet.com is a blog.&quot;;\r\n\r\n\/\/ outputs: &quot;ActionSnippet.com is a website. ActionSnippet.com is a blog.&quot;;\r\ntrace(words);\r\n\r\n\/\/ the &quot;\/g&quot; tells it to replace all instances of ActionSnippet.com\r\nwords = words.replace(\/ActionSnippet.com\/g, &quot;SomeWebsite.com&quot;);\r\n\r\n\/\/ outputs: SomeWebsite.com is a website. SomeWebsite.com is a blog.\r\ntrace(words);\r\n<\/pre>\n<p>Just a quick response to a student question. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>var words:String = &quot;ActionSnippet.com is a website. ActionSnippet.com is a blog.&quot;; \/\/ outputs: &quot;ActionSnippet.com is a website. ActionSnippet.com is a blog.&quot;; trace(words); \/\/ the &quot;\/g&quot; tells it to replace all instances of ActionSnippet.com words = words.replace(\/ActionSnippet.com\/g, &quot;SomeWebsite.com&quot;); \/\/ outputs: SomeWebsite.com is a website. SomeWebsite.com is a blog. trace(words); Just a quick response to a student [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,21],"tags":[3,4,74],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-string-manipulation","category-strings","tag-actionscript","tag-flash","tag-regular-expressions"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}