Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-10-2022, 07:47 AM
paulkaye paulkaye is offline Using find/replace to insert a word while retaining wildcard-found text Windows 10 Using find/replace to insert a word while retaining wildcard-found text Office 2016
Advanced Beginner
Using find/replace to insert a word while retaining wildcard-found text
 
Join Date: Nov 2011
Posts: 84
paulkaye is on a distinguished road
Default Using find/replace to insert a word while retaining wildcard-found text

I'm sure this is possible, but I can't figure it out.


I often have a numbered list of items. Not Word-formatted numbering, but rather plain-text numbering, such as

1. An apple
2. A pear
3. Horses
4. Donkey

(I note that the gap between the period and the list item is normally a tab rather than a space.)

I'd like to use find-replace to end up with:

Example 1. An apple
Example 2. A pear
Example 3. Horses
Example 4. Donkey

For reasons that are complicated to explain, I cannot use the paragraph-end mark of the previous item as part of the string to find. For example, finding ^p and replacing it with ^pExample won't work in my situation. Instead, I need to be able to find any number followed by a period, and replace it with the same text, just with the prefix "Example ". My lack of find-replace skills means that I don't know how to tell Word to replace the found number with whatever number was found in each case.

The closest that I came was, with wildcards switched on:
find: ([0-9]{1,}.)
replace: Example \1

but for reasons I simply cannot even imagine, the result is:
Exampl1.e An apple
Exampl2.e A pear
Exampl3.e Horses
Exampl4.e Donkey

Making it even more confusing, is that if I do this:
find: ([0-9]{1,}.)^t
replace: Example \1^t

the result is:
Examp1.le An apple
Examp2.le A pear
Examp3.le Horses
Examp4.le Donkey


If a macro is a better way to go, I'm fine with that, too.
Hope the problem is clear. Any help would be most appreciated!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard find/replace wildcard question hephalumph Word 1 03-12-2022 12:54 AM
Need Help With Find and Replace Wildcard rsrasc Word VBA 9 10-13-2015 02:37 PM
Using find/replace to insert a word while retaining wildcard-found text Find-replace using part of what was found in the replacement text paulkaye Word 3 12-22-2014 02:52 AM
Using find/replace to insert a word while retaining wildcard-found text Need help using WildCard Find & Replace Cayce Word 1 06-09-2014 04:17 PM
Using find/replace to insert a word while retaining wildcard-found text Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:18 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