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

GREP style not recognizing my colon

Community Beginner ,
Dec 10, 2020 Dec 10, 2020

Copy link to clipboard

Copied

I am currently using: 

\W+|\b(?!(Hello|There)\b)\w+

Which looks like this:

Hello There: You

I tried adding:

\W+|\b(?!(Hello|There|:)\b)\w+

but obviously this didn't work. 😞 haha

I need to amend the grep to include the colon without changing much else about it as it also effects text boxes that don't have colons and are based on other words. Been looking for a while and just not finding a solution. Any help would be appreciated.

TOPICS
How to , Scripting

Views

330

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
Advocate ,
Dec 10, 2020 Dec 10, 2020

Copy link to clipboard

Copied

If you are adding this grep using javaScript, then you need to keep in mind about Escape character.

If JavaScript then this should be added : "\\W+|\\b(?!(Hello|There|:)\\b)\\w+"

 

If any other way, please elaborate your concern.

 

Best

Sunil

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 ,
Dec 11, 2020 Dec 11, 2020

Copy link to clipboard

Copied

@fquinnc 

Please give us more example text for your Grep.

What you have - and what you want.

 

And please write in which way you want to use your Grep.

Grep Find and Replace?

Grep style in paragraph format?

Grep in a script?

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 Beginner ,
Dec 11, 2020 Dec 11, 2020

Copy link to clipboard

Copied

Of course! It's a paragraph style, linking to a character style.

so I have two instances of text. 

1. Hello: there

2. Bye for now

In order to apply the character style to the end of the text I'm using
 \W+|\b(?!(Hello|Bye|for)\b)\w+

Which gives me

1. Hello: there

2. Bye for now

But I'd like to include the colon in the "Hello:"

 

Does that help or do you need more context?

 

 

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 ,
Dec 11, 2020 Dec 11, 2020

Copy link to clipboard

Copied

LATEST

What is your rule for that?

A single word followed by colon or the first two words?

Or something different?

 

Please explain a bit more in detail. And please give a longer example text (before AND after)

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