{"id":22731,"date":"2019-05-05T19:58:32","date_gmt":"2019-05-05T18:58:32","guid":{"rendered":"https:\/\/jurnsearch.wordpress.com\/?p=22731"},"modified":"2019-05-05T19:58:32","modified_gmt":"2019-05-05T18:58:32","slug":"some-useful-regex-commands-for-notepad","status":"publish","type":"post","link":"https:\/\/jurn.link\/jurnsearch\/index.php\/2019\/05\/05\/some-useful-regex-commands-for-notepad\/","title":{"rendered":"Some useful regex commands for Notepad++"},"content":{"rendered":"<p>Perhaps it&#8217;s just the influence of Inkle&#8217;s new <em>Heaven&#8217;s Vault<\/em> game, with the epigraphy of its mysterious alien inscriptions, but I&#8217;ve taken a bit of a shine to regex. My first failed tests with the <a href=\"https:\/\/notepad-plus-plus.org\/\">Notepad++ regex<\/a> were obviously with the &#8216;wrong type&#8217; of regex, as I now know there are slightly different versions for Windows, Linux etc. But I&#8217;ve now found commands that do work for me.<\/p>\n<p>The following were found by scouring forums and were then tested while learning more about Notepad++ and how it works (it&#8217;s <em>a lot<\/em> deeper than it looks). They&#8217;re actual working practical examples, tested and working with the latest Notepad++ on Windows 64-bit.  My testing suggests that exactly the same macros run differently in the old 32-bit vs. new 64-bit Notepad++.  Since (so far as I can tell) plugin activity cannot be recorded in macros, I assume the difference is due to regex support.<\/p>\n<p>Please note that I am clueless about writing these things, only knowing how to search for, find and test them. So don&#8217;t ask me to advise you on their devising or tweaking. My many thanks especially to guy038 at the Notepad++ forum, and many and various others, for writing these and helping others find solutions. I found that the search-engine <a href=\"http:\/\/www.yippy.com\/\">Yippy<\/a>, based on Bing, is especially good at finding these things, and will almost inevitably lead you to guy038. But, so far as I know, he has not made a regex &#8216;keyring&#8217; or a &#8216;cookbook&#8217; or suchlike. Hence my need to collect some working examples here under practical headings.<\/p>\n<p>All but one of these regexes (regexii?) run in the &#8216;Find&#8217; or &#8216;Replace&#8217; box in Notepad++. One needs to run in the &#8216;Mark&#8217; tab in the same box&#8230;<\/p>\n<p><a href=\"https:\/\/jurn.link\/jurnsearch\/2019\/05\/replace.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-22732\" src=\"https:\/\/jurn.link\/jurnsearch\/2019\/05\/replace.jpg?w=529\" alt=\"\" width=\"529\" height=\"329\" \/><\/a><\/p>\n<p>On your keyboard, it&#8217;s useful to know that <strong>Ctrl + Home<\/strong> will take your text cursor (&#8216;caret&#8217;) back to the top of the Notepad++ page, which may be useful if you are building these commands into a recorded macro.<\/p>\n<p>Lastly, using regex to fiddle with public HTML seems to be frowned on, so I suggest the following are useful for certain offline text cleaning and data-swivelling operations, not for mission-critical coding or live pages.<\/p>\n<hr>\n<p><strong>The list:<\/strong><\/p>\n<p>The list has to be posted here in plain text as a .PDF.  I had a blog post all done and polished, but then found that WordPress.com blogs make an utter mess of posted regex code, even when wrapping it with the <strong>code<\/strong> tags which are supposed to protect snippets of code! So here are the working regexes in a handy four-page .PDF file&#8230;<\/p>\n<p><strong><a href=\"https:\/\/jurn.link\/jurnsearch\/2019\/05\/regex2020.pdf\">regex2020.PDF<\/a><\/strong> (updated May 2020)<\/p>\n<p><strong>New version!<\/strong> <a href=\"https:\/\/jurn.link\/jurnsearch\/2020\/09\/27\/free-my-little-regex-cookbook-for-notepad\/\">My Little Regex Cookbook, for Notepad++<\/a> (updated September 2020)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Perhaps it&#8217;s just the influence of Inkle&#8217;s new Heaven&#8217;s Vault game, with the epigraphy of its mysterious alien inscriptions, but &hellip;<\/p>\n<p><a href=\"https:\/\/jurn.link\/jurnsearch\/index.php\/2019\/05\/05\/some-useful-regex-commands-for-notepad\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-22731","post","type-post","status-publish","format-standard","hentry","category-jurn-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/posts\/22731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/comments?post=22731"}],"version-history":[{"count":0,"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/posts\/22731\/revisions"}],"wp:attachment":[{"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/media?parent=22731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/categories?post=22731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jurn.link\/jurnsearch\/index.php\/wp-json\/wp\/v2\/tags?post=22731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}