{"id":4367,"date":"2021-08-06T15:45:25","date_gmt":"2021-08-06T07:45:25","guid":{"rendered":"https:\/\/www.ookangzheng.com\/?p=4367"},"modified":"2021-08-12T14:52:06","modified_gmt":"2021-08-12T06:52:06","slug":"the-power-of-regex-in-vscode","status":"publish","type":"post","link":"https:\/\/www.ookangzheng.com\/the-power-of-regex-in-vscode\/","title":{"rendered":"The power of regex in VSCode"},"content":{"rendered":"\n

Remove lines<\/h2>\n\n\n\n

Example raw data<\/p>\n\n\n\n

\n\nstspg-webhook.xxx.io\n\nxxx.io\n\nslackbot.xxx.io\n\nxxx.io\n\njp-api.xxx.io\n<\/code><\/pre>\n\n\n\n

Solution<\/h3>\n\n\n\n
  1. Remove all top level domain with new lines
    1. Search with ^xxx.io$<\/code> , replace with empty string<\/li><\/ol><\/li>
    2. Remove all empty new lines
      1. ^\\n\\n<\/code> <\/li>
      2. ^\\n<\/code><\/li><\/ol><\/li><\/ol>\n\n\n\n

        Photo by Joshua Aragon<\/a> on Unsplash<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

        Remove lines Example raw data Solution Remove all top level domain with new lines Search with ^xxx.io$ , replace with…<\/p>\n","protected":false},"author":1,"featured_media":4373,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43,37,39],"tags":[],"class_list":["post-4367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev","category-linux","category-mac"],"_links":{"self":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/comments?post=4367"}],"version-history":[{"count":1,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4367\/revisions"}],"predecessor-version":[{"id":4374,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4367\/revisions\/4374"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media\/4373"}],"wp:attachment":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media?parent=4367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/categories?post=4367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/tags?post=4367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}