search/replace entire sentences

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to figure out how to search a document for sentances that all
start with a similar thing.

For instance, I have many sentences I need to find that look like this:

I: So, it sounds like you need to go shopping, is that correct?


All the sentences start with "I:" and then end with a question mark. I need
to delete all these sentences. Can I do this with search and replace?

thanks
 
You can use "wildcards" in a Replace operation
(http://www.gmayor.com/replace_using_wildcards.htm). For this example, you
would click the More button in the dialog and check the "Use wildcards" box,
then enter in the Find What box

I:*\?

Leave the Replace With box empty and click the Replace All button.

The expression in the Find What box uses the asterisk (*) character to match
any characters that occur between the "I:" and the next question mark. The
backslash is needed to make the ? match an actual question mark character,
instead of its special meaning of "match any single character". By leaving
the Replace With box empty, you're telling Word to replace the matched
sentence with nothing, which is the same as deleting it.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Back
Top