{"id":688,"date":"2010-03-20T15:11:06","date_gmt":"2010-03-20T09:41:06","guid":{"rendered":"http:\/\/kedar.nitty-witty.com\/?p=688"},"modified":"2023-05-20T14:27:56","modified_gmt":"2023-05-20T14:27:56","slug":"working-with-editplus-text-editor-regular-expression-how-to","status":"publish","type":"post","link":"https:\/\/kedar.nitty-witty.com\/blog\/working-with-editplus-text-editor-regular-expression-how-to","title":{"rendered":"Working with EditPlus Text Editor-Regular Expression How To"},"content":{"rendered":"\n<p>Editplus is a lot better than the regular text editor, Notepad. From all it&#8217;s features I like RegExp Support the most, and than comes the block select feature. Here are the quick lines to carry out regular tasks using regular expression in Editplus. Most steps will also work with other editors supporting regular expressions like Notepad++.<\/p>\n\n\n\n<p>It&#8217;s kinda downloadable editplus regular expression cheetsheet list.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How To Remove all empty lines in EditPlus or Notepad++<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"^\\n\" (Ignore double-quotes in all find\/replace)\nReplace: \"\"\n\nWhere,\n^ - Beginning of the line\n\\n - New Line<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>How To Remove Multiple Spaces convert into single space in EditPlus or Notepad++<br><\/h2>\n\n\n\n<p>Find: &#8221; +&#8221;<br>Replace: &#8221; &#8220;<br>Where,<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How To Find one or more occurance of space character  EditPlus<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Comment multiple line of code:<br>Find: \"^\"<br>Replace: \"#\" or \"\/\/\"<br>You may optionally use: Edit Menu &gt; Format &gt; Line Comment.<br><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How To Generate Comma Separated List from new line delimited list<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"\\n\"\nReplace: \", \"\nThis helps in even joining some of lines of code instead of replacing by comma you may replace it with \"\".<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How To Manipulate columns display order \/ punctuation<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\nFind: \"(&#91;0-9]+)\\t(&#91;a-zA-Z]+)\"\nReplace: \"\\2\\t\\1\"\n\nWhere,\n&#91;0-9]+ - Finds one or more digits\n&#91;a-zA-Z]+ - Finds one or more characters\n() - mark the block or capture the group\n\\2 - 2nd mark expression\n\nFor example original text as follows:\n123 abc\n345 cde\n567 efg\n\nbecomes:\nabc 123\ncde 345\nefg 567\n<\/code><\/pre>\n\n\n\n<p>The Other Way:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">- Press Alt+C\n- Drag you mouse to select respective column and click\n- Copy \/ Cut as required<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Append \/ Add semicolon (any character) at the end of the line<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"\\n\"\nReplace: \";\\n\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Enclose lines by quotes<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"\\n\"\nReplace: \"'\\n'\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Delete all lines containing a given STRING<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"^.<em>STRING.<\/em>$\"\nReplace: \"\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>How To Remove lines not containing a given STRING<\/h2>\n\n\n\n<p>I don&#8217;t know how to do this!! \ud83d\ude42<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How To Convert tab separated file into insert statements<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><br>TSV: abcd de4 iirn 34399<br>SQL: INSERT INTO TABLENAME VALUES (\"abcd\", \"de4\", \"iirn\",\"34399\");<br>Find: \"(.<em>)\\t(.<\/em>)\\t(.<em>)\\t(.<\/em>)\"<br>Replace: \"INSERT INTO TABLENAME VALUES (\"\\1\", \"\\2\", \"\\3\",\"\\4\");\"<br>Format the telephone number:<br>Find: \"(&#91;0-9]&#91;0-9]&#91;0-9])(&#91;0-9]&#91;0-9]&#91;0-9])(&#91;0-9].*)\"<br>Replace: \"\\1-\\2-\\3\"<br>For example:<br>Original: 1231231231<br>Formatted text becomes: 123-123-1231<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How To Remove Brackets<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Find: \"(|)\"\nReplace: \"\"\nWhere,\n( -&gt; Match (. \\ is required to escape marking the expression.\n| -&gt; or\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How To Replace 1st&nbsp;occurrence&nbsp;of character<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><br>Find: \" (.<em>)\" Replace: \"-\\1\" Where, (.<\/em>) - matches everything and marks the block<br>** Make sure you ignore double-quotes(\") while writing in find \/ replace boxes.<br>EditPlus supports following regular expressions in Find, Replace and Find in Files command.<br>Expression - Description<br>\\t - Tab character.<br>\\n - New line.<br>. - Matches any character.<br>| - Either expression on its left and right side matches the target string.<br>&#91;] - Any of the enclosed characters may match the target character.<br>&#91;^] - None of the enclosed characters may match the target character.<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>- Character to the left of asterisk in the expression should match 0 or more time.<br>- Character to the left of plus sign in the expression should match 1 or more times.<br>? - Character to the left of question mark in the expression should match 0 or 1 time.<br>^ - Expression to the right of ^ matches only when it is at the beginning of line.<br>$ - Expression to the left of $ matches only when it is at the end of line.<br>() - Affects evaluation order of expression and also used for tagged expression.<br>\\ - Escape character. If you want to use character \"\\\" itself, you should use \"\\\".<br><\/code><\/pre>\n\n\n\n<p>Notable Features of Editplus are<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Spell checking\nRegex-based find &amp; replace\nEncoding conversion\nNewline conversion\nSyntax highlighting\nMultiple undo\/redo\nRectangular block selection\nAuto indentation\nCode folding (Text folding)<\/code><\/pre>\n\n\n\n<p>Download pdf: <a href=\"http:\/\/kedar.nitty-witty.com\/wp-content\/uploads\/2010\/03\/editplus-regexp.pdf\">Editplus-RegExp<\/a>.<\/p>\n\n\n\n<p>Conclusion: EditPlus, with its support for regular expressions, offers a versatile platform for efficient text editing and manipulation. By mastering the techniques covered in this article, you can harness the full power of regular expressions in EditPlus to streamline your workflow, automate repetitive tasks, and achieve cleaner and well-formatted text. Take advantage of features like spell checking, encoding conversion, syntax highlighting, and more, as EditPlus empowers you to become a proficient text editor. With regular expressions as your tool, the possibilities are endless in EditPlus. Elevate your text editing game and unlock new levels of productivity with these invaluable tips and tricks.<\/p>\n","protected":false},"excerpt":{"rendered":"Editplus is a lot better than the regular text editor, Notepad. From all it&#8217;s features I like RegExp Support the most, and than comes the block select feature. Here are&hellip;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6],"tags":[39,203,99,426,119,125],"class_list":{"0":"post-688","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-technical","7":"tag-editplus","8":"tag-reg-exp","9":"tag-regular-expression","10":"tag-technical","11":"tag-tool","12":"tag-windows"},"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/comments?post=688"}],"version-history":[{"count":4,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/688\/revisions"}],"predecessor-version":[{"id":2908,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/688\/revisions\/2908"}],"wp:attachment":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/media?parent=688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/categories?post=688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/tags?post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}