#1
|
|||
|
|||
Regular Expression Syntax to Search for Alternative Words
Greetings,
I have looked into this at length before, and found no solid answers. I am working with records that include repetitive verbiage except that one phrase may be slightly different from record to record. My overall purpose is to make use of a macro that isolates the unique phrase. Here is a greatly-simplified example: The red bicycle had a flat tire but Bart fixed it on the third attempt. The red bicycle had a flat tire but Bart fixed it on the first attempt. The red bicycle had a flat tire but Bart fixed it on the ninth attempt. The red bicycle had a flat tire but Bart fixed it on the twelfth attempt. I desire to structure a single macro command that will search my content for first or third or ninth or twelfth, instead of creating four separate commands that look for each distinct word seriatim. If I undertake the latter for the content with which I am working, the macro is likely to be painfully long. What is the Word 2007-specific, wild-card syntax for accomplishing a search for alternative words? Does such a thing exist? I am aware there is a method to search for alternative letters within a string, but that does not address this specific problem. If something similar exists for whole words, I have not discovered it. I appreciate your kind feedback. Thanks and regards, q. |
#2
|
||||
|
||||
There is no wildcard Find expression for that. That said, for the example you gave you might try a wildcard Find with:
Find = <[! ]@[fhinorx][snrt][dth]>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you for that feedback; it confirms what I was guessing, but "fear of missing out" induces questions of the sort that I pressed.
I will tuck away the example you kindly provided in the event I decide to use something similar. Thanks again, and regards, q. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA code to enable Regular Expression | ronmayerle | Word VBA | 2 | 11-20-2014 01:09 PM |
Regular Expressions: match words within quotes? | tinfanide | Word VBA | 3 | 02-02-2013 10:07 PM |
Perform a search for alternative words | jungkim | Word | 2 | 03-24-2012 07:40 AM |
regular Expressions Formatting for Search | sesproul | Mail Merge | 1 | 11-30-2011 05:02 AM |
Instant Search syntax for relative dates | eagleeye | Outlook | 1 | 05-16-2011 03:58 PM |