Find/replace double cap letters

A

Ann

My document lists names by 1st initial of first name and
full last name (JSmith). I want to insert a space between
the 2 cap letters. Is there a find/replace way of doing
this?

Thanks
Ann
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Ann > écrivait :
In this message, < Ann > wrote:

|| My document lists names by 1st initial of first name and
|| full last name (JSmith). I want to insert a space between
|| the 2 cap letters. Is there a find/replace way of doing
|| this?
||

In the Find/Replace dialog, check "Generic characters".

Then, in the Find what box, type:
([A-Z])([A-Z])
and in the Replace with box, type:
\1 \2
(Do not forget the space between the \1 and the \2!)
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
H

Helmut Weber

Hi Ann,
try this, with matchwildscards on
search for
<([A-Z]{1})([A-Z]{1}[a-z]{1,})>
where "," is the listseperator for English
which would be ";" in German, Dutch
(and a user named Nora from Libanon reported
her listseperator was ";", too)
replace with
\1 \2
Note that there is a space in the above line between \1 and \2.
The search is for 1 capital letter followed by 1 capital letter
followed by 1 or more letters, that are not capitals,
where the first letter is expression \1 and the rest is
expression \2.
\1 gets replaced by itself, then a space is added,
then \2 gets replaced by itself.
 
H

Helmut Weber

Hi Jean-Guy,
Hi Ann,
acknowledged, "{1}" is of no use, (always learning)
whereas
Then, in the Find what box, type:
([A-Z])([A-Z])
and in the Replace with box, type:
\1 \2
would change "Word MVP" to "Word M VP".
And I think, Ann might not have considered
cases like "HGWells" or "EGRobinson".
---
Good evening, good night, wherever you are
it is 23:05 here
Greetings from Bavaria
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Helmut Weber > écrivait :
In this message, < Helmut Weber > wrote:

|| Hi Jean-Guy,
|| Hi Ann,
|| acknowledged, "{1}" is of no use, (always learning)
|| whereas
||| Then, in the Find what box, type:
||| ([A-Z])([A-Z])
||| and in the Replace with box, type:
||| \1 \2
|| would change "Word MVP" to "Word M VP".
|| And I think, Ann might not have considered
|| cases like "HGWells" or "EGRobinson".

Very true! Always thinking ahead of the pack, as usual!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top