Copy link to clipboard
Copied
I have a doc full of text without spaces after colons, e.g. "Next Step:Organize Tools."
I want to add a space after the colon.
Terms like "Next Step" appear regularly throughout, and are easy to find; additionally, there are URLs in which I don't want to add space after a colon.
- - -
So, I can search for "Step:\S" which finds the colons, but it also selects the next letter, e.g. "Next Step:Organize Tools."
- - -
How do we tell GREP to NOT select the next character, and simply add a space after the colon?
FWIW I have the GREP in InDesign book, but don't know what this function is called & couldn't find it...
Thanks!
Thanks @Rob @FRIdNGE
I looked a bit closer at the book and indeed kind of found this solution, for example:
Find Step:(?=\S)
Replace Step:_ (that's just a space, not an underscore.)
@FRIdNGE , this seems to work, but is there an advantage to using $0? I think you're maybe just referring to the find result?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Grep Find: :(?=\S)
Grep Replace by: $0
($0 followed by a normal space)
(^/) The Jedi
Copy link to clipboard
Copied
Thanks @Rob @FRIdNGE
I looked a bit closer at the book and indeed kind of found this solution, for example:
Find Step:(?=\S)
Replace Step:_ (that's just a space, not an underscore.)
@FRIdNGE , this seems to work, but is there an advantage to using $0? I think you're maybe just referring to the find result?
Copy link to clipboard
Copied
Yes! You simply search ":"
(^/)
Copy link to clipboard
Copied
Wouldn't that find every instance of ":" though?
Copy link to clipboard
Copied
The regex will find ALL the ":" followed by a char that is a "\S"
That means no catch if the ":" is followed by a normal space, a no-break space, a tab, a carriage-return, a soft-return, …
(^/)