Copy link to clipboard
Copied
Hi,
I have used below grep to find the ellipsis in my indesign file through script with various condition, such as three dots (...) with before space, after space and without space [my requirement], but greps are highlighted the text which is really not required. I have not included such condition but assigned greps running that also. please advice.
highlight('\\w+.?\\h? . . .\\h?.?\\w+');
highlight('\\w+.?\\h?. . . \\h?.?\\w+');
highlight('\\w+.?\\h?. . .\\h?.?\\w+');
Extra highlighted by script (which is not required):
Exact expectation by greps (my requirement):
thanks in advance.
by
hasvi
but everything find everywhere
Sure, because it is different logic used there. It fixes errors, but you need just to point to a misspell made, instead of fixing it…
Well, these two regexes may be useful. Works in F/C panel, also can be used as a para style option:
[\w\.,]\K\.~<\.~<\.
\.~<\.~<\.(?=\w)
Copy link to clipboard
Copied
I'm a bit lost what are you trying to achieve here, actually?
Three dots are just three dots, and ellipsis has its own special glyph. Instead of trying to mimic it inserting spaces between dots, why not just use correct glyph? Start with:
Find what
\h?\.[.\h]{2,}
Change to:
\x{2026}
Copy link to clipboard
Copied
Hi, you are right we are using three dots instead of ellipsis. My result should be:
"\h?\.[.\h]{2,}" this grep finding all three dots, but I expect the actual grep should find only the yellow highlighted text.
by
hasvi
Copy link to clipboard
Copied
we are using three dots instead of ellipsis
and do you have any good reason to do so?
I still couldn’t get what are you trying to achieve. You want find something and… what? Apply formatting, replace with something else? Or just have a space before and after your triple dots, except position right after opening quote?
This last assumption seems most likely to me, and I’d do this in 3 simple F/C steps:
1. Insert a regular space before/after all triple dots, with Hair Spaces in between:
Find: \.~<\.~<\.
Change to: \x{20}$0\x{20}
2. Replace multiple spaces to singles:
Find: \x{20}+
Change to: \x{20}
3. Remove spaces at the beginning of paragraphs and after opening quotes (be careful to use right quotation mark!):
Find: (^|“)\K\x{20}
Change to: leave blank
Copy link to clipboard
Copied
Hi,
Here nothing to confusion. I just want to find the yellow highlighted dots (as shown in example above - before and after dots extactly). Need greps to find yellow highlighted text only.
By
Hasvi
Copy link to clipboard
Copied
Here nothing to confusion.
Unfortunately, there is.
Just finding something means nothing by itself. What is your final goal, what you want to do with found text? It is complicated to find optimal solution without knowing what you're after. I asked you a few simple questions, and without answers it's pointless to proceed.
Now you can only search for each instance separately:
find triple dot preceded by a letter and followed by a space / find triple dot preceded by a space and followed by a letter, and so on.
Copy link to clipboard
Copied
Hi, our pre-editors make this mistake frequently. As per the client guide line three dots should come with before and after space such as "sample . . . text". If this condition missed by pre-editors (as shown in image above with yellow highlighted) we first highlight that scenario and pass those information to pre-editors to make error report.
This is the exact requirement. I hope its clear now.
By
Hasvi
Copy link to clipboard
Copied
Hi,
I tested with all above suggested greps but everything find everywhere. But I want to find exactly yellow highlighted condition only.
Thanks in advance for your help.
By
Hasvi
Copy link to clipboard
Copied
but everything find everywhere
Sure, because it is different logic used there. It fixes errors, but you need just to point to a misspell made, instead of fixing it…
Well, these two regexes may be useful. Works in F/C panel, also can be used as a para style option:
[\w\.,]\K\.~<\.~<\.
\.~<\.~<\.(?=\w)
Copy link to clipboard
Copied
I'd recommend positive lookahead and lookbehind if you don't want to include the words in your search. The following GREP will find the ellipses – as created in your example – if a hard space is present at the front and a regular space is present after the ellipses:
(?<=~S)\.~<\.~<\.(?=\s)
The following will find the ellipses with or without spaces at the front or back, but not include the words:
(?<=\w)\s?\.~< \.~< \.\s?(?=\w+)
Copy link to clipboard
Copied
Hi Colin,
I tried with these two but not find anything:
(?<=~S)\.~<\.~<\.(?=\s)
(?<=\w)\s?\.~< \.~< \.\s?(?=\w+)
by
hasvi
Copy link to clipboard
Copied
thanks for your swift reply and it works well.
by
hasvi