

It’s very easy to forget to escape special characters properly. Special character manipulation requires you to make use of escape characters. This is also a good technique to learn other operators, but only frequent use of the operators will help you to remember them indefinitely. If you keep forgetting the operators ^ and $ you should print out the regex sheet cheat I linked above and pin it to your board and one glance is sufficient to remind you of regular expressions. Next, we are adding something to the end: However, the ALT + F + mouse selection key combo does not work so well for adding characters after each line, so you’re better off learning regex.įirst, let’s add something before each line: Excel makes it very easy to do this, but in notepad++ you have to use regular expressions or use the key combo ALT + F to mark multiple rows. My cursor currently is at the very end, so when I say Replace All, it says “0 occurrences”.Īdding character to beginning or end of lineĪnother common operation you will encounter every other day is adding characters before or behind a line that you copied from Excel. You first need to tell notepad++ to move the cursor to the first line, first position. Step One common mistake notepad++ beginners make is that they forget that notepad++ basically behaves like a sophisticated typewriter. Wait! It says 0 occurrences, what am I doing wrong?Ĥ.

Step When you hit Replace All, it should replace all empty lines in your document At the bottom check the option Regular Expression and enter \n\r into the search field. Step Now hit CTRL + F and go to the tab Replace. Step Open notepad++ – you should have something like this with empty lines:Ģ. Example:Ī useful cheat sheet can be found here Replacing Empty Lines In Notepad++ġ. and + your last operator will tell the preceding operator how to match a string. \n\r – entire blank line (carriage return + line break).\r – carriage return (move to first position in line, also known as CR).\n – line break (LF/Line Feed, next line, not moving cursor).


Some of the operators date back to old typewriters, but all in all it’s not so difficult to understand: Regex (regular expressions) are extremely powerful when it comes to string modification. Notepad++ is a nifty tool that includes a regex search-and-replace feature.
