![]() |
#1
|
|||
|
|||
![]()
I'm trying to use a wildcard find/replace to find strings like "word1 word2 and word3 word2", like "anionic groups and cationic groups". I'd like to delete the second unnecessary word2, so the replaced string would be "anionic and cationic groups". I'm using
Find = (<*>) (<*>) and (<*>) \2 Replace = \1 and \3 \2 But this finds all the text from the insertion point up to the desired Find string. In a long document, this find/replace takes a very long time, for some reason, although the Replace does work. How can I find just the specified pattern without the preceding text? |
#2
|
||||
|
||||
![]()
You could reduce your Find/Replace expressions to:
Find = ( [! ]@)( and [! ]@)\1 Replace = \2\1
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thanks so much, Paul; your suggestion works perfectly. I'll study how it works, which is the best way to learn.
|
![]() |
Tags |
wildcard searches |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word wildcard search for paragraphs with single words | littlenellie | Word | 7 | 02-20-2024 04:19 PM |
VBA wildcard search that only identifies results that do not follow delineated words | rekent | Word VBA | 4 | 09-23-2021 10:55 AM |
Wildcard Search | gmaxey | Word VBA | 4 | 07-12-2020 05:13 PM |
![]() |
Maksymromaniuk | Word | 1 | 11-02-2015 01:04 PM |
Wildcard search help. | Kempston | Word | 0 | 11-13-2009 03:58 AM |