#1
|
|||
|
|||
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find and replace text in a document with wildcards in vba | marcotte974 | Word VBA | 2 | 06-22-2022 10:38 PM |
Help with WildCards Find & Replace either or nothing... | Cendrinne | Word VBA | 9 | 11-14-2020 08:25 AM |
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 |