Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word: Search and Replace using wildcards

Status
Not open for further replies.

s0ccerdude

Technical User
Jul 2, 2003
38
US
I know that Word can be used to search for strings using wildcards. Can it also Replace using strings as well?

For example, I know that this can be done:
Find what: !*!
Replace with: soccer

Before Search and Replace:
"My favorite sport is !football!."

After Search and Replace:
"My favorite sport is soccer."

My question is, can this be done:
Find what: soccer
Replace with: !*!

Before Search and Replace:
"Do you know where the soccer field is? I know that the
!football! field is over here."

After Search and Replace:
"Do you know where the football field is? I know that the
!football! field is over here."

In other words, I want to replace characters using wildcards and strings in the Search and Replace function. I do not need to use wildcards in the search field.




 
Hi s0ccerdude,

Sorry, but I don't understand; replacing with a wildcard makes no sense. In your example how is Word supposed to know that "!*!" means "football"?

I can't give a general solution without a bit more detail, but you can replace elements of the found string, so you could do something like this, which would do the replace you show ..

Find: [purple][tt](soccer)(*)(\!)(*)(\!)[/tt][/purple]
Replace: [blue][tt]\4\2\3\4\5[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top