Skip to main content
Known Participant
September 18, 2019
Question

Wanteed a Grep in Indesign to search for white spaces

  • September 18, 2019
  • 1 reply
  • 2394 views

Hi team,

I wanted a grep in Indesign which can search the white spaces before a letter (alphabet or digit) and has a specific Paragragh style and then replace the white Nonbreaking Space (Fixed Width).

The spaces before the letter can be one or many. This is used for the indentaion of the codes.

For Example:

Please help me.

 

Regards

Arvind

 

    This topic has been closed for replies.

    1 reply

    vladan saveljic
    Inspiring
    September 18, 2019

    if the spaces you want to replace are always after soft return (as in your screenshots) one way to find them could be this grep

    \n\K\x20+

    Known Participant
    September 25, 2019

    Thanks for the reply.

    But unfortuntately sometime I have hard enters also. I am look for a grep which could find the space before a letter or a digit of a paragraph style.

    I have searched with the Grep that you have provided me:

    Find: \K\x20+
    Replace:  ~s

    but when I replace with Non-Breaking space all the spaces are replaced with one. I want all the spaces to be replaced with Non-breaking spaces.

     

    Please help me.

     

    Regards

    Arvind

    vladan saveljic
    Inspiring
    September 25, 2019

    are the spaces you want to find and replace, always at the beginning of paragraph?

    in that case try this grep:

    ^\x20+