Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2024, 12:17 PM
wardw wardw is offline Wildcard search using (<*>) (<*>) finds too many words Windows 11 Wildcard search using (<*>) (<*>) finds too many words Office 2021
Advanced Beginner
Wildcard search using (<*>) (<*>) finds too many words
 
Join Date: Oct 2012
Posts: 65
wardw is on a distinguished road
Default Wildcard search using (<*>) (<*>) finds too many words

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?
Reply With Quote
  #2  
Old 09-02-2024, 03:28 PM
macropod's Avatar
macropod macropod is offline Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words Windows 10 Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could reduce your Find/Replace expressions to:
Find = ( [! ]@)( and [! ]@)\1
Replace = \2\1
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-03-2024, 11:27 AM
wardw wardw is offline Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words Windows 11 Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words Office 2021
Advanced Beginner
Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words
 
Join Date: Oct 2012
Posts: 65
wardw is on a distinguished road
Default

Thanks so much, Paul; your suggestion works perfectly. I'll study how it works, which is the best way to learn.
Reply With Quote
Reply

Tags
wildcard searches



Similar Threads
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
Wildcard search using (&lt;*&gt;) (&lt;*&gt;) finds too many words Wildcard to find any one or more words Maksymromaniuk Word 1 11-02-2015 01:04 PM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft