Copy link to clipboard
Copied
Hi,
I want to change any multiple spaces and any tabs, to a single space.
the GREP code for multiple spaces is " +" and for tab is "^t", there is any way to combine these in a single GREP line, or I need to do 2 separate actions?
To make the question simple: How can I find and change the letters "A" and "B", to "C" in one action?
There is a code that combine characters? Something like this?
Thanks a lot!
Haim
Okay, I found it - thanks to your help:
^[\t ]+
Thanks again guys!
Copy link to clipboard
Copied
In F/C dialog GREP tab:
Find what:
\h+
Change to:
\s
This will change any combination of horizontal space(s) (incl. tabs) into one single space.
Copy link to clipboard
Copied
The code for a single tab is not ^t -- that is the code for a tab in the regular Find/Change, not in GREP. The proper code for a tab is \t.
To combine several possible characters into one 'find' code, use a Character Set: [xyz] will look for one of 'x', 'y', or 'z'. You can also include predefined sets into this, so [\u1] will look for any single uppercase character OR the digit '1'. Your example for 'A' and 'B' would be
[AB]
and for 'any space OR any tab' you'd use
[\t ]
(where there is a space before the end ]).
See the online help for more about the supported GREP codes: Find/Change text in InDesign
Copy link to clipboard
Copied
Thanks a lot guys,
winterm - it didn't work for me. I'm working on CS5, if it matters.
Jongware - I need to replace all the spaces and tabs that founds at the beginning of a paragraph, with nothing (delete them).
Copy link to clipboard
Copied
^\h+
(^/)
Copy link to clipboard
Copied
Okay, I found it - thanks to your help:
^[\t ]+
Thanks again guys!
Copy link to clipboard
Copied
Obi's ^\h+ will find any white space, (i.e., non breaking spaces, en space, em space, etc.).
^[\t ]+ will only find tabs and multiple normal spaces, so below it would find the space in front of paragraph 1 but not paragraph 2
Copy link to clipboard
Copied
Thanks,
For me - ^[\t ]+ found all the multiple spaces and tabs at the beginning of every paragraph in the document, and remove them. that's what i needed.