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="http://windows7themes.net/test.zip"> 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. Click on Search
2. Click on Bookmark
3. 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


Or you might like these sexy wallpaper, tweaks and themes:

Written by oliversk Friday, December 16th, 2011

Was it helpful? Please bookmark it and spread the word

delicious   facebook   google   twitter  

You love Windows, Gaming and everything digital? Great, we too! We have thousands of great Windows 7 themes, registry tweaks, tutorials, so please use our search box if you look for anything specific. If you have some awesome desktop themes, tips or want to write for us, then drop us a mail: win7themes at googlemail.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>