#1
|
|||
|
|||
Find and Replace - How to insert brackets around all numbers in a doc
Hi, simple question for the right person: I've got a 350 page document which for work I have to insert [square brackets] around certain numbers throughout the doc.
The doc is mostly text, but there are references to section numbers like "see Section 3.1" and "see Section 10.13" etc throughout - I need to change them all so they read "see Section [3.1]" and "see Section [10.13]". There are hundreds of these references so it isn't practical to edit one by one. I've done lots of research on wildcards for find and replace, so I have no problem finding these references <(Section )*(.)*> but can't work out how to do a single find-replace to insert the [ ] around all sorts of different numbers, without changing the numbers. This is literally (ok not literally) killing me, spent hours on it so far. Please help!! |
#2
|
|||
|
|||
Solved my own problem and thought I'd post it in case it helps:
Find: <(Section )(*).(*)> Replace: \1[\2.\3] |
#3
|
||||
|
||||
The wildcard '*' is a blunt instrument and should be treated with caution ... and you only need two pairs of brackets in the search string. I would have suggested
(Section )([0-9.]{3,}) replace with \1[\2] See http://www.gmayor.com/replace_using_wildcards.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find and replace BETWEEN numbers | WordUser2015 | Word | 4 | 12-19-2014 02:09 PM |
find and replace consecutive numbers | kpl_39 | Word | 1 | 06-07-2013 05:04 AM |
Find/Replace Brackets Problem | fatso | Word | 2 | 08-04-2011 11:34 AM |
Find & Replace formula for numbers? | Griff | Word | 4 | 04-18-2011 02:47 AM |
Find & Replace Insert Issue | mipacker | Word | 0 | 02-18-2009 08:59 AM |