How to find sentences that end in periods with no space after them

Home Forums General InDesign Topics How to find sentences that end in periods with no space after them

Tagged: ,

This topic contains 5 replies, has 3 voices, and was last updated by  Aaron Troia 1 week, 2 days ago.

  • Author
    Posts
  • #100092

    Sheri G
    Member

    Working on a tough manuscript that has dozens and dozens of instances where one sentence runs into the next, without a space following the period. How do you search for that? Is there a way to search for “period, followed by no space?” If so, how would you write that?

    Thanks!

  • #100093

    Graham Park
    Member

    In the FIND/REPLACE dialogue box choose the GREP tab and use the below.
    This will find non space character (it will find letters, numbers and punctuation) followed by a period follow by a capital letter and will add a space between them.
    If you have two fullstops in a row or ., it will find them as well
    Second one will find a lowercase character followed by a period followed by a Capital letter
    Choose which one suits you best.

    Find
    (\S\.)(\u)
    or
    (\l\.)(\u)
    Replace
    $1\x{0020}$2

    \x{0020} = This is just a visible space character, you can just type a space in between the found items,

  • #100103

    Sheri G
    Member

    Thanks for this! It will help parse some of this. However, since this is a novel, many of these run-on sentences have quote issues, such as:

    I wondered what he was doing here.”Hey, Michael—what’s up?” I asked.
    Where did the time go?”I have to work tomorrow, so we need to cut this short.”
    “Let’s get together again soon.”I knew I’d never see her again.

    So, it can be a period, followed by an opening quote. Or a question mark, followed by text or an opening quote. Or, it can be an end-quote, followed by a capital letter.

    This is really a mess. I do appreciate anything that can help. Thanks!

  • #100104

    Graham Park
    Member

    I thin you will need two operations. First one will find the period followed by a double quote and the second the period or ! or ? and add the space.

    Find
    (\.”)(\S)
    Replace
    $1\x{0020}$2

    Then
    (\S[\.|?|!])(\S)
    Replace
    $1\x{0020}$2

  • #100106

    Graham Park
    Member

    You will probably also need to do a Find space ” and replace with ” to get rid of the extra space that has been added

  • #100139

    Aaron Troia
    Member

    Been playing around with this, it might work for you, and should only be one step

    Find: (\.|(?:\.|\?)~}|(?:\.|\?)~{)(\w)
    Replace $1 $2

    That will find just periods, periods with opening and closing parentheses, and questions marks followed by opening and closing parentheses.

    Aaron

    • This reply was modified 1 week, 2 days ago by  Aaron Troia.

You must be logged in to reply to this topic.