Search and Replace Text Using Regular Expressions in Notepad++

Search and Replace Text Using Regular Expressions in Notepad++


Demonstration of using Notepad++ to search and replace text via Regular Expression.

This example uses an XML formatted file where we want to remove all instances of a particular XML element/tag regardless of the XML element's content/value.
Closed Caption:

this video is going to show you how to
use notepad plus plus to search and
replace text in a text file in this case
it's an XML formatted file using regular
expressions just to cut to the chase
here i want to in this xml file remove
anything that has this XML tag
yeah anything that has this XML tech
regardless of the value i'm going to
search for just the siege underscore ID
tag and we'll see how many exist so we
see that there's 12,000 908 matches for
the CH underscore ID xml tag i want to
remove all of those tags i should note
that the this xml file happens to have
values none other than eight letters and
numbers so inside this inside of all of
the 12,000 tags in here the value within
the tag will either be a letter or
number and only a single letter or a
single numbers
ATZ 0 through 9 to give you an example
or but that's it
so here's how you do it in notepad plus
plus we're going to i'm gonna select it
the tag and the whole opening closing
tag and then hit ctrl h and I want to
replace it with nothing so i'll leave
that open i make sure that in the search
mode regular expression is selected now
here's where the regular expression
kicks in
we're going to use surround the regular
expression with parentheses and brackets
so we have a opening and opening
parenthesis in opening bracket closing
bracket closing parenthesis now within
this inside the opening and closing
brackets we're going to put our regular
expression in this case I know that I'm
i want to search for anything and a
through z or
r & 039 so this regular expression
specifies that with inside the CH
underscored opening and closing tags
search any value a300 39 can exist and
if you find that can replace it with
nothing
so here we go to replace all we should
get 12,000 908 records who only 12,000
97 so I missed a spot somewhere we can
go look for that but you get the idea
12,000 over 12,000 records research to
replaced with nothing using that regular
expression

Video Length: 02:56
Uploaded By: jalbao
Published: 7/15/2011
View Count: 106,899

Related Software Products
Web Search and Replace
Web Search and Replace

Published By:
DataMystic

Description:
Ultimate Webmaster search and replace tool. Search and replace files and folders of unlimited size. Replace multiple search terms simultaneously. Import search and replace lists from Excel. Find and replace Unicode phrases. Search with Regex patterns and EasyPatterns, with predefined patterns for [Whitespace], [Date], [Time], [IPAddress], [EmailAddress]. Find and Replace multi-line text, special characters. Restrict find and replaces to line or column ranges, HTML tags, such as within the ALT ...


Related Videos
Advanced Search and Replace With RegEx
Advanced Search and Replace With RegEx

Video Length: 23:34
Uploaded By: Tuts+ Computer Skills (8/31/2013)
View Count: 19,114

How to search and replace text in a document
How to search and replace text in a document

Video Length: 01:59
Uploaded By: ViewHowTo (6/10/2012)
View Count: 16,745

How to Perform a Search and Replace on a WordPress Website
How to Perform a Search and Replace on a WordPress Website

Video Length: 04:40
Uploaded By: wpmodder (8/17/2010)
View Count: 15,408

Search and Replace for Chrome
Search and Replace for Chrome

Video Length: 01:33
Uploaded By: Chris Taylor (10/29/2012)
View Count: 7,904

How to Search and Replace Text in Excel and Word Files in Batch
How to Search and Replace Text in Excel and Word Files in Batch

Video Length: 01:41
Uploaded By: howtechoffice (9/9/2014)
View Count: 7,251

How Can I Search & Replace in Multiple Word Documents at One Go
How Can I Search & Replace in Multiple Word Documents at One Go

Video Length: 03:50
Uploaded By: Pitch St (4/8/2013)
View Count: 6,250

How to to Search and Replace Words/Characters in Excel Different Files (XLS, XLSM, XLSX)
How to to Search and Replace Words/Characters in Excel Different Files (XLS, XLSM, XLSX)

Video Length: 03:29
Uploaded By: Pitch St
View Count: 2,394

Copyright © 2026, Ivertech. All rights reserved.