0

I want to change the spacing on citations in my document. They currently look like:

something [1]

And I want them to look like:

something[1]

There are dozens of citations in my document, so I would like to use the find feature in Word to make this less tedious.

From reading this I tried to make a wildcard that would match, but it doesn't work.

Find: ([A-z]@>) (\[[0-9]*\])

Replace: \1\2

The Find doesn't work. So, I do not know if the Replace will either. What am I missing? Thanks for your help!


Edit: here is what I get when I enter ^w:

^w is not a valid special character

wdkrnls
  • 1,534

2 Answers2

0

Word uses special characters in search and replace. If you are just trying to remove any white space before any instance of an open square bracket you can replace ^w[ with [. ^w is Word's way of representing white space for purposes of a find.

Jason Aller
  • 2,360
0

IF it is acceptable to remove a single space immediately before the opener of a square bracket pair containing anything, then the following should work:

Find what:    ([ ])(\[*\])  
Replace with: \2  

SU258904 example

The Find is in two parts (i) [ ] and (ii) \[*\], with the parts separated within parentheses. It is in two parts so that, having found what we are looking for, we can replace just the second part (ie \2) - hence removing the space which is all that is the first part (ie [ ]). [The square brackets are not actually needed here but show that there is a space better than just ( ) in most fonts.]

Looking for anything is the purpose of *. Your citations are encapsulated within characters that happen to have special significance in this context (ie square brackets) so these must be 'escaped' to be taken literally. The escaping is done with a back slash. So \[ is the opener [ and \] is the closer ].

You were exceedingly close with your attempt!

Further details available here for example.

pnuts
  • 6,242