Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2023, 03:44 AM
danhayter88 danhayter88 is offline Find and replace with wildcards but keep formatting Mac OS X Find and replace with wildcards but keep formatting Office 2021
Novice
Find and replace with wildcards but keep formatting
 
Join Date: Dec 2023
Posts: 1
danhayter88 is on a distinguished road
Default Find and replace with wildcards but keep formatting

Hi there,





I am doing a find and replace with wildcards to automatically replace parentheses within parentheses with square brackets: for example: "Hi there (test (test 2))" should become "Hi there (test [test 2])"

It goes something like this:

Find: ([\(])([!\)]@)([\(])(*)([\)])(*)([\)])

Replace: \1\2[\4]\6\7

It works well, except that if anything like italics are involved, the square brackets don't match the formatting of the original brackets. For example:

"Hi there (test (test 2))" becomes "Hi there (test [test 2])"

Any obvious way to make sure that any new text inserted matches the formatting of the expression it replaces?

Cheers
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace with wildcards but keep formatting Find and replace text in a document with wildcards in vba marcotte974 Word VBA 2 06-22-2022 10:38 PM
Find and replace with wildcards but keep formatting Help with WildCards Find & Replace either or nothing... Cendrinne Word VBA 9 11-14-2020 08:25 AM
Find and replace with wildcards but keep formatting Find and replace text with wildcards arunchandar9 Word VBA 15 06-30-2019 01:06 AM
Using wildcards how do I Find and Add to, not replace Stargehzer Word 3 01-25-2016 09:14 PM
Find & Replace: Wildcards (except this pattern) tinfanide Word 6 01-26-2014 06:39 AM

Other Forums: Access Forums

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