Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2017, 03:29 PM
ballpoint ballpoint is offline Wildcards: searching for multiple words / expressions close to each other Windows 10 Wildcards: searching for multiple words / expressions close to each other Office 2016
Advanced Beginner
Wildcards: searching for multiple words / expressions close to each other
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default Wildcards: searching for multiple words / expressions close to each other

Hi all,

I am trying to find a way to search for similar words cited in the same passage / paragraph of text. I am doing that so I can build a collection of passages citing works of the same authors. The idea is to be able to find passages that contain two or more specific words / expressions, which could be somehow far apart.

in my pipe dream, I would have one operator searching for (by way of example):

"Tolstoy" and "War and Peace" and "first edition"

and then another searching for

"Tolstoy" and "Anna Karenina" and "second edition"



Of course, I could search for one and refine the search later, but there are quite a few similar instances and, most importantly, I have so many cases that this could be very complicated. Moreover, I would like to be able to use the paragraph-exporting macro that macropod so kindly and cleverly created to do the bulk of the work.

I have no idea if this is possible, and I cannot seem to be able to understand whether there is some wildcard syntax that would make it so. If, however, this is possible, my life will be immensely easier.

Thanks a lot!
Reply With Quote
  #2  
Old 11-07-2017, 03:44 PM
ballpoint ballpoint is offline Wildcards: searching for multiple words / expressions close to each other Windows 10 Wildcards: searching for multiple words / expressions close to each other Office 2016
Advanced Beginner
Wildcards: searching for multiple words / expressions close to each other
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

I hope this is not wrong, but I think I have found an answer and I'd gladly contribute it to the knowledge base. I am asking the administrators to please remove it if it is wrong.

I had fairly good results with this type of wildcard:

Code:
word1[!^013]*word2
. I am not quite sure yet of whether it only stops at the paragraph end, but it seems promising.
Reply With Quote
  #3  
Old 11-07-2017, 08:43 PM
macropod's Avatar
macropod macropod is offline Wildcards: searching for multiple words / expressions close to each other Windows 7 64bit Wildcards: searching for multiple words / expressions close to each other Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 might try a wildcard Find expression like:
Find - <(word)>[!^13]@<\1>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 11-08-2017, 03:27 AM
ballpoint ballpoint is offline Wildcards: searching for multiple words / expressions close to each other Windows 10 Wildcards: searching for multiple words / expressions close to each other Office 2016
Advanced Beginner
Wildcards: searching for multiple words / expressions close to each other
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

Thank you! To be clear, in your version it would be something like:

Find - <(Tolstoy)>[!^13]@Karenina<\1>

Or am I just misunderstanding the syntax?

Thanks!
Reply With Quote
  #5  
Old 11-08-2017, 04:56 AM
macropod's Avatar
macropod macropod is offline Wildcards: searching for multiple words / expressions close to each other Windows 7 64bit Wildcards: searching for multiple words / expressions close to each other Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

The expression I posted would find any two instances of the whole word 'word' in the same paragraph.

If you want to find Tolstoy before Karenina in a paragraph, you'd use:
Find = <(Tolstoy)>[!^13]@<Karenina>
The < & > symbols are there to ensure you get whole-word matches only.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 11-08-2017, 06:00 AM
ballpoint ballpoint is offline Wildcards: searching for multiple words / expressions close to each other Windows 10 Wildcards: searching for multiple words / expressions close to each other Office 2016
Advanced Beginner
Wildcards: searching for multiple words / expressions close to each other
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

This is extraordinary and solves so many of my problems that I cannot even begin to tell you how much the months to come will be made easier.

As a follow-up question, is a Word / Office wildcard cheatsheet available somewhere? Most of the documentation I have found was a little fragmented.

Thanks!

Beyond that, I also wonder if it would not be possible to use something like the Fuzzy Lookup addin (https://www.microsoft.com/en-us/down....aspx?id=15011) for something like this.
Reply With Quote
  #7  
Old 11-08-2017, 12:57 PM
macropod's Avatar
macropod macropod is offline Wildcards: searching for multiple words / expressions close to each other Windows 7 64bit Wildcards: searching for multiple words / expressions close to each other Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 ballpoint View Post
As a follow-up question, is a Word / Office wildcard cheatsheet available somewhere? Most of the documentation I have found was a little fragmented.
See:
https://support.office.com/en-us/art...4-7708c6c779b7
http://www.gmayor.com/replace_using_wildcards.htm
Quote:
Originally Posted by ballpoint View Post
Beyond that, I also wonder if it would not be possible to use something like the Fuzzy Lookup addin (https://www.microsoft.com/en-us/down....aspx?id=15011) for something like this.
I don't know of a fuzzy-match addin for Word. That said, using VBA there are numerous additional matching options available, including:
• IgnorePunct - ignores punctuation in found text
• IgnoreSpace - ignores extra white space in found text
• MatchAllWordForms - (also available via the GUI) finds all forms of the find text, e.g. if the text to find is "sit," "sat" and "sitting" are also found
• MatchPhrase - ignores all white space and control characters between words
• MatchPrefix - matches words starting with the search string
• MatchSoundsLike - (also available via the GUI) matches words that sound similar to the text to find
• MatchSuffix - matches words ending with the search string
• MatchWholeWord - (also available via the GUI) matches only entire words
These don't all work with wildcards and I've rarely needed to call on any of them. YMMV
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 11-09-2017, 03:30 PM
ballpoint ballpoint is offline Wildcards: searching for multiple words / expressions close to each other Windows 10 Wildcards: searching for multiple words / expressions close to each other Office 2016
Advanced Beginner
Wildcards: searching for multiple words / expressions close to each other
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

This is excellent. Thank you so much!
Reply With Quote
Reply

Tags
multiple, wildcards

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcards: searching for multiple words / expressions close to each other Regular Expressions / Wildcards: [1990] --> (1990) tinfanide Word 2 08-10-2015 02:34 PM
Wildcards: searching for multiple words / expressions close to each other Searching for words across all file formats sunalta Windows 2 01-22-2014 08:00 AM
Wildcards: searching for multiple words / expressions close to each other Regular Expressions: match words within quotes? tinfanide Word VBA 3 02-02-2013 10:07 PM
Wildcards: searching for multiple words / expressions close to each other Searching Multiple PowerPoint & Word Files BobbyAre PowerPoint 14 08-12-2012 06:52 AM
Wildcards: searching for multiple words / expressions close to each other searching for text in multiple excel files roytom Excel 2 07-30-2012 01:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:14 AM.


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