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

hyphenated text two color

Participant ,
Jan 06, 2018 Jan 06, 2018

Copy link to clipboard

Copied

Hi scripters;

There is a hyphenated text frame. Is there a way I can be black and magenta.

examlar.jpg

thanks..

TOPICS
Scripting

Views

684

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 ,
Jan 06, 2018 Jan 06, 2018

Copy link to clipboard

Copied

Provisionally: No script needed, a GREP style should be able to do that.

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
Enthusiast ,
Jan 06, 2018 Jan 06, 2018

Copy link to clipboard

Copied

Like these:

grep to hyphen.jpg

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 ,
Jan 07, 2018 Jan 07, 2018

Copy link to clipboard

Copied

this method does not work correctly

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
Enthusiast ,
Jan 07, 2018 Jan 07, 2018

Copy link to clipboard

Copied

Well, we tried.

So, you need to be more specific in your needs. Because looks to work for

me.

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 ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

uniqued_tol  wrote

this method does not work correctly

Yes it does. Are you sure you followed the steps correctly?

1. create an 'invisible' character style to hide the hyphens

2. create a 'magenta' character style to color the text

3. apply 'invisible' to the text "-" (without these quotes)

4. apply 'magenta' to the text "(?<=-)\w+(?=-|$)" (again without the quotes)

5. Result:

where the top is your image, bottom is what I get with lf.corullon​'s code. Just in case he was trying to fool you or something (well he wasn't).

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 ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

Thank you any idea!

exam2.jpg

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
Enthusiast ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

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 ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

Hi;

It is still unsatisfactory for me, the code includes char before and after!

corr.jpg

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 ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

LATEST

Thanks for your comments

The code that Jedi gives is <<perfect>> and <<simple>>.

.+?-\K\w+

"When a grep code is beautiful and works really fine, Grep is truly an awesome feature!" Jedi.

jedi.jpg

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