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

Complicated GREP style to bold a colon and escape a colon

Contributor ,
Nov 05, 2014 Nov 05, 2014

Here is my challenge in a one-size-fits-all GREP style.   I am trying to write a grep style will make an exception for the colon in 7:30 but will bold all characters and including the colon in the “Today” example.

here is what I have tried   >>   ^[^?!:]+:      This does a good job forgetting any subsequent colons and trapping the first one in Bold.  However, it will bold all the characters including the colon in the first example.

So I then tried to combine the first part of the GREP with this >>  (\d:\d)   but that didn't do anything. 

The quick brown fox jumped over the lazy dog’s back at 7:30 pm. He was late for an appointment.


Today: Watch the quick brown fox jumped over the lazy dog’s back at 7:30 pm. He was late for an appointment.



Should I be exploring a Match?

Thanks, everyone.

TOPICS
Scripting
413
Translate
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

Enthusiast , Nov 05, 2014 Nov 05, 2014

If I understand the goal correct, you want to find a colon, but not when the colon is followed by a number.

So try this one: ^[^?!:]+:(?!\d)

Translate
Enthusiast ,
Nov 05, 2014 Nov 05, 2014

If I understand the goal correct, you want to find a colon, but not when the colon is followed by a number.

So try this one: ^[^?!:]+:(?!\d)

Translate
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
Contributor ,
Nov 05, 2014 Nov 05, 2014
LATEST

Kai, you are simply amazing.  Right under my nose.

I hope this benefits everyone in our community who finds themselves in a Catch 22.

thank you so much,

Chuck

Translate
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