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