View Single Post
Old 11-10-2012, 11:47 AM
jeffk jeffk is offline Windows 7 64bit Office 2007
Advanced Beginner
Join Date: Jul 2012
Location: North of England, UK
Posts: 33
jeffk is on a distinguished road
Default wildcards in find & replace to reverse word order

I'm trying to use wildcards in Find & Replace to reverse the order of names in a list from surname, first name e.g.

Blogs Fred --> Fred Blogs
Smith John --> John Smith
Doe John
Etc SoForth

I thought that I needed to select ‘Use wildcards’ & type \1 \2 in the ‘Find what’ field & \2 \1 in the ‘Replace with’ field, but when I do this & click ‘Replace All’ I get an error message:

“The Replace with group text contains a number which is out of range”

What's going on here? What am I doing wrong?

OK, I just tried (<*>) (<*>) in 'find what' & \2 \1 in 'replace with' & it works as long as I select the list of names first, otherwise it applies to everything in the document & messes up the text.

I'm sure that I've done this in the past & it’s worked without me having to select text first, but I can’t remember how..............any suggestions?

Also, I still don't understand why the first way didn't work & what the error message actually means, so any clarification still welcomed!


Last edited by jeffk; 11-10-2012 at 01:11 PM. Reason: additional info
Reply With Quote