|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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 |
#3
|
||||
|
||||
You might try a wildcard Find expression like:
Find - <(word)>[!^13]@<\1>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
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! |
#5
|
||||
|
||||
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] |
#6
|
|||
|
|||
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. |
#7
|
||||
|
||||
Quote:
https://support.office.com/en-us/art...4-7708c6c779b7 http://www.gmayor.com/replace_using_wildcards.htm Quote:
• 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] |
#8
|
|||
|
|||
This is excellent. Thank you so much!
|
Tags |
multiple, wildcards |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regular Expressions / Wildcards: [1990] --> (1990) | tinfanide | Word | 2 | 08-10-2015 02:34 PM |
Searching for words across all file formats | sunalta | Windows | 2 | 01-22-2014 08:00 AM |
Regular Expressions: match words within quotes? | tinfanide | Word VBA | 3 | 02-02-2013 10:07 PM |
Searching Multiple PowerPoint & Word Files | BobbyAre | PowerPoint | 14 | 08-12-2012 06:52 AM |
searching for text in multiple excel files | roytom | Excel | 2 | 07-30-2012 01:57 PM |