Want to delete an entire line if an item is found

General discussions about Advanced Find and Replace
Post Reply
darren

Want to delete an entire line if an item is found

Post by darren » Mon Jan 31, 2005 5:32 pm

Hello,

I want to search for a word and delete the entire line if the word is found. Please let me know how to do that.

Thanks!

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Mon Jan 31, 2005 5:32 pm

Read the page with exact answer:
http://www.abacre.com/afr/manual/regexpfaq.htm

Darren

Re: Want to delete an entire line if an item is found

Post by Darren » Mon Jan 31, 2005 5:32 pm

darren wrote:Hello,

I want to search for a word and delete the entire line if the word is found. Please let me know how to do that.

Thanks!


Thanks very much for the speedy response! I still have two issues. In the example that you answered with, it does not do all that it states. If you try it, it deletes all of the first two lines but not all of the last occurance. Strange.

Also, on my issue, here is the example:

<html>
<head>
<title>John Doe</title>
</head>
<BODY BACKGROUND=back.gif TEXT=#000000 LINK=#0000ff>
<CENTER><TABLE WIDTH=550 border=0><TR><TD><center>
<h1>John Doe</h1>
</center>
<hr size=7 width=95%>

I use john.*\r\n and it does not do anything when executed.

Thanks!

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Mon Jan 31, 2005 5:32 pm

Try this:

^.*john.*\r\n

so:
^ means start of the line
.* - any char

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests