How to mark or bookmark lines in notepad+++ using regular expressions

I’m a fan of everything that makes Windows 7 easier. Autohotkey and Notepad++ make my life easier, so here’s another tutorial that explains a few tricks.

notepad plus plus regex

Notepad++ Makes Your Life Easier

You probably heard of regular expressions? Regular expressions basically allow you to search for patterns in a text and replace it with whatever you want. It’s also used to create URL rewriting rules using Apache’s mod_rewrite.

Anyway, notepad++ supports regular expressions which can make your day-to-day work easier. For example you can mark or bookmark lines in notepad++ and then perform operations on the marked lines.

Remove marked lines with RegEx (.*)

Let’s say you have a list of zip files with URL’s that you want to mark and remove

href=""> Stuff

Now, even if you don’t understand regular expressions, you can do A LOT just knowing that (.*) stands for all characters and [a-z] stands for all lowercase alphabetic characters.

Take a look how I can mark ALL lines that have a zip file a href tag and are using the li tag:
Mark bookmark lines noteplad plus plus

IMPORTANT: Keep in mind, to match the rule you need line items that exactly match it, even the space character after zip”>

Remove Marked Lines

Check the option bookmark line as seen above and you can then remove all marked lines.

1. Step Click on Search
2. Step Click on Bookmark
3. Step Click on Remove bookmarked lines

You can do all sorts of useful things with that now. If you want to do even more cool stuff, I suggest to learn a little regex.
Book about regular expressions

Published: Friday, December 16th, 2011 Last Modified: December 16, 2011

Related Posts

Rate This Article
5 of 5 0 (100%) 1 vote