How can I search for lines not ending with a punctuation mark?

I

ISay

I am trying to edit a document which was not formatted correctly. I am
trying to find lines in which a carriage return was entered before the end of
the sentence in order to replace it with a space. i.e.

Now is the time for
all good men to come to the aid of their party.

I want it to correct it so that it reads:

Now is the time for all good men to come to the aid of their party.
 
Y

Yves Dhondt

What you could try is look for a break followed by a lower case letter and
replace that.

Find what: "^13([a-z])" (without the quotes)
Replace with: " \1" (without the quotes)

Alternatively, you could look for a break where there is no punctuation in
front and replace that:

Find what: "([!\.\!\?])^13" (without the quotes)
Replace with: "\1 " (without the quotes)

Or you could combine the above two: no punctuation, a break, and a lower
case character:

Find what: "([!\.\!\?])^13([a-z])" (without the quotes)
Replace with: "\1 \2" (without the quotes)

Make sure "Use wildcards" is selected in the dialog.

Yves
 
I

ISay

([!\.\!\?])^13 this one almost worked but it didn't add the space between the
words. The result was:

Now is the time forall good men to come to the aid of their party.
 
S

Suzanne S. Barnhill

Did you include the space in the "Replace with" text (before \1)?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

ISay said:
([!\.\!\?])^13 this one almost worked but it didn't add the space between
the
words. The result was:

Now is the time forall good men to come to the aid of their party.



Yves Dhondt said:
What you could try is look for a break followed by a lower case letter
and
replace that.

Find what: "^13([a-z])" (without the quotes)
Replace with: " \1" (without the quotes)

Alternatively, you could look for a break where there is no punctuation
in
front and replace that:

Find what: "([!\.\!\?])^13" (without the quotes)
Replace with: "\1 " (without the quotes)

Or you could combine the above two: no punctuation, a break, and a lower
case character:

Find what: "([!\.\!\?])^13([a-z])" (without the quotes)
Replace with: "\1 \2" (without the quotes)

Make sure "Use wildcards" is selected in the dialog.

Yves
 
I

ISay

I totally missed the space in the "Replace with". I did have to modify the
search to read, ([!\.\!\?\"])^13 to include the quotation marks.

Thanks.
 

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

Similar Threads


Top