Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2022, 02:23 AM
wrdy wrdy is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows XP Is there a way to Find multiple text strings in a Word document in a single operation? Office 2007
Advanced Beginner
Is there a way to Find multiple text strings in a Word document in a single operation?
 
Join Date: Jan 2014
Posts: 31
wrdy is on a distinguished road
Default Is there a way to Find multiple text strings in a Word document in a single operation?

I can find "1" or "2" or "3" using wildcards like this:



Find: [123]

but is there a way to find "1st" or "2nd" or "3rd"?


In Google Docs you can use regular expressions:


Find: 1st|2nd|3rd


Any way to do this in Word?
Reply With Quote
  #2  
Old 04-02-2022, 03:03 AM
gmayor's Avatar
gmayor gmayor is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows 10 Is there a way to Find multiple text strings in a Word document in a single operation? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

A wildcard search for
[123][dnrst]{2}
will find those examples - Replace using wildcards
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 04-02-2022, 04:08 AM
wrdy wrdy is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows XP Is there a way to Find multiple text strings in a Word document in a single operation? Office 2007
Advanced Beginner
Is there a way to Find multiple text strings in a Word document in a single operation?
 
Join Date: Jan 2014
Posts: 31
wrdy is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
A wildcard search for
[123][dnrst]{2}
will find those examples - Replace using wildcards

Perfect! That works nicely.
Reply With Quote
  #4  
Old 04-02-2022, 04:18 AM
wrdy wrdy is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows XP Is there a way to Find multiple text strings in a Word document in a single operation? Office 2007
Advanced Beginner
Is there a way to Find multiple text strings in a Word document in a single operation?
 
Join Date: Jan 2014
Posts: 31
wrdy is on a distinguished road
Default

What about for something like this:


Find: Mr Mrs Dr Prof Sgt Pres (but NOT Sir and Miss)


so I can Replace with: Mister Misses Doctor Professor Sergeant President
Reply With Quote
  #5  
Old 04-02-2022, 09:22 PM
macropod's Avatar
macropod macropod is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows 10 Is there a way to Find multiple text strings in a Word document in a single operation? Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
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

Finding them all could be done with a Single wildcard Find, but replacements would require individual Find/Replace operations. For a macro you could adapt for that, see: https://www.msofficeforums.com/55215-post6.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 04-03-2022, 09:17 AM
Charles Kenyon Charles Kenyon is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows 10 Is there a way to Find multiple text strings in a Word document in a single operation? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,470
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by wrdy View Post
What about for something like this:

Find: Mr Mrs Dr Prof Sgt Pres (but NOT Sir and Miss)

so I can Replace with: Mister Misses Doctor Professor Sergeant President

Paul has given you a macro that can do multiple replaces. Just writing to note that Mrs. is not an abreviation for Misses (which is the multiple of Miss) but rather Missus which I have not seen used much.

Mr., Mrs., Ms., and Miss: Everything You Need to Know About Titles
Reply With Quote
  #7  
Old 04-03-2022, 06:38 PM
wrdy wrdy is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows XP Is there a way to Find multiple text strings in a Word document in a single operation? Office 2007
Advanced Beginner
Is there a way to Find multiple text strings in a Word document in a single operation?
 
Join Date: Jan 2014
Posts: 31
wrdy is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Finding them all could be done with a Single wildcard Find, but replacements would require individual Find/Replace operations. For a macro you could adapt for that, see: https://www.msofficeforums.com/55215-post6.html

So, would this be the best way to find what I want: ([MDPS][rgsotef]{1,3})( )
Reply With Quote
  #8  
Old 04-03-2022, 06:41 PM
wrdy wrdy is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows XP Is there a way to Find multiple text strings in a Word document in a single operation? Office 2007
Advanced Beginner
Is there a way to Find multiple text strings in a Word document in a single operation?
 
Join Date: Jan 2014
Posts: 31
wrdy is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Paul has given you a macro that can do multiple replaces. Just writing to note that Mrs. is not an abreviation for Misses (which is the multiple of Miss) but rather Missus which I have not seen used much.

Mr., Mrs., Ms., and Miss: Everything You Need to Know About Titles

O, I didn't realize that. It is funny that there is an "r" in "Mrs" but not in "Missus".
Reply With Quote
  #9  
Old 04-03-2022, 07:22 PM
macropod's Avatar
macropod macropod is offline Is there a way to Find multiple text strings in a Word document in a single operation? Windows 10 Is there a way to Find multiple text strings in a Word document in a single operation? Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
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

Quote:
Originally Posted by wrdy View Post
So, would this be the best way to find what I want: ([MDPS][rgsotef]{1,3})( )
If all you're interested in is finding them, but not replacing them, I would use just: <[DMPS][efgorst]{1,3}>
Do be aware, though, that you're liable to get false matches, such as:
Deer, Deft, Do, Door, Meet, Mess, Moss, Most, Pee, Pest, Pete, Poor, Sear, Seer, See, Set, Sore,
etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to Find multiple text strings in a Word document in a single operation? Find What Text (^&) is not working for find Italic formatted strings Mercurial Word 5 06-29-2021 05:20 PM
Search Multiple Strings and if Present get single word as output transactions Excel Programming 1 05-17-2019 11:18 AM
Is there a way to Find multiple text strings in a Word document in a single operation? word 2013 operation on text dogufo Word 9 04-05-2019 04:04 AM
Is there a way to Find multiple text strings in a Word document in a single operation? Search Multiple strings and create new word file subodhgupta Word 4 05-22-2014 03:34 AM
Is there a way to Find multiple text strings in a Word document in a single operation? Copying Multiple tables from excel into a single word document dineshtgs Word Tables 1 04-07-2011 01:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:40 PM.


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