-
1. Re: Can Grep do this for me?
Eugene Tyson Oct 5, 2010 6:04 AM (in response to Maria964)You do a search for a SPACEs followed by ONE SINGLE CHARACTER followed by a SPACEs
Which would be
Find
\s+(.)\s+
Change to
~S$1~S
-
2. Re: Can Grep do this for me?
[Jongware] Oct 5, 2010 6:18 AM (in response to Eugene Tyson).. Unfortunately, no.
Eugene, the Hard Return is also a 'space' character; Maria's red rectangled marker would also get picked up. The simple solution would be to not use \s, but type a regular space instead -- but that won't work either!
Maria, GREP can do a lot but it cannot locate the end of a line, only that of a paragraph. So there is no way to distinguish between your marked end-of-line single characters, and the single character in line #3. For GREP, the entire paragraph is treated as a single long line up to the Hard Return.
-
3. Re: Can Grep do this for me?
[Jongware] Oct 5, 2010 6:26 AM (in response to Maria964)On second thought, I think you don't want to search-and-replace but just want those single characters to be kept together with the next word ...
That is quite easy with a GREP style (have we mentioned those before?). Create a Character Style containing just No Break -- leave all other settings blank. Then create a GREP style, applying this No Break style to
\<\w \w
(note there is a single regular space in the middle).
It has a sort of unexpected side-effect: a sequence of "a b c d" is not grabbed into one long string, but rather into two separate ones: "a b" "c d". As a consequence, this line may be broken between the two pairs, which I think is very fortunate!
But if you don't want that, use this GREP instead:
\<\w (?=\w)
-- it will keep any long sequence of loose letters together, so it may result in overset text in extreme cases. -
4. Re: Can Grep do this for me?
Maria964 Oct 5, 2010 7:21 AM (in response to [Jongware])Thank you Jongware and Eugene,
I had forgotten to mention that I was really looking for is a grep style to avoid single letters at the end of paragraph lines.
But Jongware, who besides being a magician with scripting, can also read minds through the net, solved the problem. In the midlle of the paragraphs there will be some "no breaking" but I think Indesign can cope with that.
Thank you again Jongware and Eugene
-
5. Re: Can Grep do this for me?
Eugene Tyson Oct 5, 2010 7:23 AM (in response to [Jongware])Ahrgh - why would it include a paragraph return as a white space? Silly GREP.
Well if you change the \s to a space character with the space bar then it works ok.
+(.) +





