• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Ellipsis (three dots) finding by GREPs issue, can anyone give suggestion?

Participant ,
Feb 22, 2019 Feb 22, 2019

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

Views

3.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Feb 25, 2019 Feb 25, 2019

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)

3dots.png

Votes

Translate

Translate
Mentor ,
Feb 23, 2019 Feb 23, 2019

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}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 24, 2019 Feb 24, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 25, 2019 Feb 25, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 25, 2019 Feb 25, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 25, 2019 Feb 25, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 25, 2019 Feb 25, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 25, 2019 Feb 25, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 25, 2019 Feb 25, 2019

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)

3dots.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2019 Feb 23, 2019

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+)

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 25, 2019 Feb 25, 2019

Copy link to clipboard

Copied

Hi Colin,

I tried with these two but not find anything:

(?<=~S)\.~<\.~<\.(?=\s)

(?<=\w)\s?\.~< \.~< \.\s?(?=\w+)

by

hasvi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

LATEST

thanks for your swift reply and it works well.

by

hasvi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines