Throughout these examples I have used the regex
YourCodeHere
to and you should change this to match your needs
Line Operations
Using a capture Group
Find: ^.*YourCodeHere(.*) Replace: YourCodeHere\1
Add to the end of a line
- Open the Replace dialogue (Ctrl + H)
- Configure as follows:
- Find what:
$
- Replace with:
your content
- Search Mode:
- Regular expression
- without `. matches newline`
- Find what:
- Click Replace All
Notes
Multiline Search and Replace
- Notepad++ replace two lines with other (10) lines in open documents - Stack Overflow
- NppToolBucket | phdesign - A .NET plugin for Notepad++
- NppToolBucket contains the following features:
- Multi-line search and replace dialog.
- Change indentation dialog.
- Generate GUID
- Generate Lorem Ipsum
- Compute MD5 Hash
- Compute SHA1 Hash
- Base 64 encode
- Base 64 decode
- NppToolBucket contains the following features:
Delete Specific lines
A couple of methods to identify lines and delete them.
Regex
- Open the Replace dialogue (Ctrl + H)
- Configure as follows:
- Find what:
.*YourCodeHere.*\n .*YourCodeHere.*\r?\n
- Replace with: nothing
- Search Mode:
- Regular expression
- without `. matches newline`
- Find what:
- Click Replace All
Notes
- The end of line character should be
\n
if straight from your Linux box, but you might just want to check this as it could be\r\n
YourCodeHere
should be swapped for something on each of the lines you want to delete.- Notepad++ Delete Lines with Find & Replace - Super User
- some useful end of line regex that might still be valid.
Bookmark Line Method
Delete all lines that don't contain ....
A couple of methods to identify lines and delete all the others.
Inverse Regex Replace
- Open the Replace dialogue (Ctrl + H)
- Configure as follows:
- Find what:
^(?!.*YourCodeHere).*\r?\n ^(?!.*YourCodeHere).*\R # When this is used, blank lines are left ^((?!YourCodeHere).)*$
- Replace with: nothing
- Search Mode:
- Regular expression
- without `. matches newline`
- Find what:
- Click Replace All
Bookmark Line Method
- Select the Mark tab from the replace dialogue (Ctrl + H)
- Enter your Regex to match code on the lines you want to keep.
YourCodeHere # This will allow marking of all lines not containing [ERROR] ^((?!YourCodeHere).)*$
- Your Regex does not need to match all of the content on the line, just something unique to allow identification.
- Check Bookmark line.
- Search Mode:
- Regular expression
- without `. matches newline`
- Click Mark All.
- Menu --> Search --> Bookmark --> Remove Non-Bookmarked Lines
- In the replace dialogue, Mark tab, click Clear all marks.
Remove Duplicate Lines
- Method 1
- Edit --> Line Operations --> Remove Duplicate Lines
- Edit --> Line Operations --> Sort Lines Lexicographically Ascending (this is optional but makes them easier to read.)
- Method 2
- Edit --> Line Operations --> Sort Lines Lexicographically Ascending
- Edit --> Line Operations --> Remove Consecutive Duplicate Lines
Delete the first part of a line
Find: ^.*YourCodeHere Replace: YourCodeHere or Find: ^.*?YourCodeHere Replace: YourCodeHere
Line Endings (EOL / CR / LF)
A collection of hints and tips of this topic.
- The default Notepad++ font `Courier New` does not support a lot of Unicode characters such as the CRLF character.
- Notepad++ End of Line: How to Change It and Why - Notepad++ end of line settings: Learn how to change the end of line character in Notepad++. This article includes step-by-step instructions and screenshots.
To View Line Endings in Notepad++:
- Go to View > Show Symbol > Show End of Line
- CR LF for Windows line endings
- LF for Unix-style
- CR for old Mac-style
- This will display actual newline characters:
- These aren’t shown as ↵, but they indicate the same thing.
If you want ↵ to Show where Newlines Occur:
Notepad++ supports showing newlines as CR/LF/CRLF
but does not support showing newlines as ↵
, however you can simulate it:
- Use Find and Replace (Ctrl+H)
- Set Search Mode to Extended
- Find: \r\n or \n
- Replace with: ↵\r\n (this will visually insert ↵ at line breaks)
- Be careful—this alters the file.
Regex
- Non-Greedy
- Notepad++ supports non-greedy regular expressions, which are useful for matching the shortest possible string that satisfies the pattern. This can be achieved using the
?
operator after a quantifier. - Notepad++ non-greedy regular expressions - Stack Overflow
- you can specify what you don't want:
a[^c]+c
- Which specifies: match
a
, followed by one or more character that isn'tc
, followed byc
. This will matchabc
andadc
.
- Which specifies: match
- you can specify what you don't want:
- Notepad++ Find and Replace Expert Suggestion - Super User
- Notepad++ supports non-greedy regular expressions, which are useful for matching the shortest possible string that satisfies the pattern. This can be achieved using the
- Line Endings (EOL)
- \R (capital R) will grab any end of line characters in Notepad++.
- ^ for start of line.
- $ for end of line, but does not identify the EOL.
- Inverse Regex Selection/Match
- see my Inverse Regex Replace under the deleting lines section.
- How can I invert my Regex matching results? - Super User
- notepad++ Inverse Regex replace (all but string) - Stack Overflow
Themes
- Notepad++ • Dracula Theme - The most famous dark theme for Notepad++ and an ever-growing selection of apps!
Misc
How to add a TPL file to Notepad++ as a PHP file
- Click Settings / Style Configurator
- Select PHP in the left list box
- At the bottom of the list boxes, you'll see User Ext:. Enter tpl into that box
- Click Save & Close
Now Notepad++ will recognise .tpl files as PHP files. When you open the next one, it will contain syntax highlighting.
A question mark or a box is shown instead of the EOL character?
- I am using the Fira Code here for this example but this will apply to all fonts where this occurs
- The EOL character is shown when using the DejaVu Mono font.
- The question mark character is shown is when the required glyph does not exist in the current font.
- When copying text, the glyph references are copied not the characters, so if a character does not show correctly in one application this does not mean this will be the same in another.
The issue you're encountering is due to the Fira Code font not supporting the ↵
character (Unicode U+21B5: "DOWNWARDS ARROW WITH CORNER LEFTWARDS").
Here's a breakdown of what's going on:
- ✅ DejaVu Mono
- DejaVu Mono is a very complete font that includes a wide range of Unicode symbols, including many technical and typographic ones.
- It supports the ↵ character, so it displays correctly.
- ❌ Fira Code
- Fira Code is a monospaced programming font known for its ligatures (like turning
!=
into a neat symbol), but it has a more limited set of Unicode glyphs compared to DejaVu Mono. - It does not include a glyph for
↵
, so Notepad++ shows a replacement character (typically a question mark or a box), indicating a missing glyph.
- Fira Code is a monospaced programming font known for its ligatures (like turning
Solutions or Workarounds
- Use a different symbol:
- You can try using a visually similar symbol that Fira Code does support (e.g.,
↩
,↓
, or⏎
), though it’s not the same.
- You can try using a visually similar symbol that Fira Code does support (e.g.,
- Use a different font:
- If Unicode coverage is important and you're dealing with many special characters, consider using a font like:
- JetBrains Mono
- Cascadia Code
- DejaVu Mono
- DejaVu Sans
- Segoe UI Symbol
- Arial Unicode MS
- Use a custom build of Fira Code with extended Unicode coverage (more advanced).
- If Unicode coverage is important and you're dealing with many special characters, consider using a font like:
- Use a different editor:
- Switch to a different editor that supports font fallback (like VS Code, Sublime Text, etc.).
To Verify a Character is supported in a font
You can test if Fira Code supports a character by:
- Checking it in a font viewer (like BabelMap or FontDrop).
- Viewing it in a browser with Fira Code explicitly set as the font.
- Set your editor to use the required font, then copy and paste in the character from somewhere it is shown correctly.
Why ↵ works in VS Code but Not in Notepad++
VS Code and Notepad++ handle fonts very differently, particularly when it comes to missing glyphs:
- ✅ VS Code: Font Fallback Support
- VS Code uses Electron/Chromium, which supports font fallback.
- When Fira Code doesn't include a glyph (like ↵), VS Code will automatically fall back to another installed font that does support it (e.g., DejaVu Sans Mono or Segoe UI Symbol).
- So even though Fira Code doesn’t include ↵, VS Code silently substitutes it from another font.
- ❌ Notepad++: No Font Fallback
- Notepad++ uses the Windows GDI or Scintilla rendering engine, which lacks proper font fallback.
- If the selected font (Fira Code) doesn’t include a glyph, Notepad++ simply shows a replacement character (usually a box or question mark), because it won’t switch to another font.
✅ Summary
App | Font Used | ↵ Glyph Supported by Font? | Font Fallback? | Result |
---|---|---|---|---|
VS Code | Fira Code | ❌ | ✅ Yes | ✔️ Displays ↵ |
Notepad++ | Fira Code | ❌ | ❌ No | ❌ Question mark |
Additional Fonts
- Notepad Plus Plus instructions · tonsky/FiraCode Wiki · GitHub - A Free monospaced font with programming ligatures.
- How to install this font into Notepad++
- Ligatures are not on by default, the DirectWrite option needs to be enabled.