Skip to main content
Known Participant
January 27, 2025
Question

Find/Change feature: no spacing between words

  • January 27, 2025
  • 2 replies
  • 484 views

Hi,

In the Find/Change feature, what code do I need to find words that don’t have a space between them? For example, like this: wordword

 

Also, is there some sort of cheat sheet where I can see all possible codes for the Find/Change feature?

 

Thank you very much!

2 replies

Community Expert
January 28, 2025

Conjoined words like wordword should be finadable

 

(?i)([a-z]+)\1

(?i): Enables case-insensitive matching, so "WordWord" and "wordword" "Wordword" are matched.
([a-z])+: Captures one or more characters a-z  into a group (the plus).
\1: Refers back to the first captured group, effectively matching the same sequence of characters immediately following the initial sequence.

 

But this only matches doubled up same words. 

 

For compound words there's legitimate cases

Football, Foot + Ball

sometime, some + time 

inside, in + side 

 

Unfortunately, there might not be an easy way except with a good proofreader. 

 

You wouldn't want 

'He went inside' to be changed to 'He went in side' 

 

Community Expert
January 28, 2025

Oh yeh forgot the important part - separating them 😄 

 

(?i)\b([a-z]+)\1\b

Replace with

$1 $1


Find queries:

 

(?i) Case-insensitive matching.
\b Word boundary to ensure the match is at the start and end of a complete word.
([a-z]+) Captures one or more word characters as a group.
\1  Backreference to the first captured group, ensuring it is repeated immediately after.
\b Another word boundary to confirm the repeated group ends the word.

 

Replace queries:

 

$1 references the first matched group (the word).

so
$1 $1 Adds a space ( ) between $1 inserts a space between the duplicated words.

James Gifford—NitroPress
Legend
January 27, 2025

Find/Change is not very strong at finding conjoined words — I'd say not at all but there may be some detail I've missed. That feature would need to use spell check features like word patterns and the spellcheck dictionary to guess that an odd/misspelled word might be two joined words (as spell checking already does). And, of course, joined words that make a valid third word would be bypassed and need to be caught by something more like grammar and language checking.

 

Short version: I don't think Find/Change or any search/replace can easily be made to find missing spaces. ETA for clarity: Spell checking, however, will find most instances of "missing spaces" and offer a one-click fix.

 

I don't know of a compact cheat sheet for Text Find/Change codes, but don't overlook that each field in all forms of F/C has a dropdown list of them, and using those for a while can be very self-teaching/learning. However, once you get past pretty simple searches, you will probably want to move to GREP, which can be used in a mode as simple as Text search but has almost astonishing power to pick desired words and elements out of a document. It, too, has drop-down menus, but I've attached a cheat sheet I worked up a few years back to help some colleagues come up to speed. From there, you'll want Peter Kahrel's definitive book on using GREP in InDesign.

 

And don't forget that ID has other search modes that are quite narrow in scope (color, glyph, object) but priceless when you need to, say, find the last instance of a color swatch that needs to be deleted.

 

MateomonoAuthor
Known Participant
January 27, 2025

@James Gifford—NitroPress

Thank you very much! I have been using the Find/Change feature at the end of the book design process to spot errors like double spacing and similar issues. Are there any other useful tools I should be using for double-checking my book file?

Also, this is a broader question, but since I don’t really have much experience in this area, I was wondering: what are some essential things that need to be double-checked in terms of the file ? Maybe there’s a cheat sheet for that. 🙂

James Gifford—NitroPress
Legend
January 27, 2025

Well, just... everything. Pretty simple. 😄

 

I mostly do my text and other checks at the time of import, but for most books, especially those actually written and developed in InDesign, my standard checklist includes —

  • Double spaces; remove them all. (Including any after periods/between sentences.)
  • Spaces before and after a paragraph break; remove them all.
  • Reduce all combinations of space+tab to just tabs.
  • Review all multiple tabs and reduce to single tabs unless the styles would get too complex.
  • Double paragraph returns (empty paragraphs); remove them all.
  • Review all line breaks/soft returns and remove all that should be style-based breaks and spacing; allow only those that efficiently and selectively fix a spot formatting problem.
  • Exhaustively spell-check.

 

There are some F/R presets that do some of this but I prefer to run each fix manually. The presets are probably fine for less demanding work like memos and other ephemeral business documents.

 

I will run this in Word before import and/or in ID after import; at (long-ish) intervals during book development; and always as part of the final tucks and tweaks for publication.

 

Since I almost always use a chapter heading page format different from the running pages, another late/last step is to page through and make sure none of the chapter beginnings have wandered off their assigned Parent page.

 

That's all just the mechanical stuff, done after passes to fix bad breaks, illustrations that have moved to a poor location, etc.