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

GREP search & replace

Explorer ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

I'm hoping someone out there knows how to do this.

I'm trying to search for ™ characters throughout a long document, then:

  1. Apply a character style to that ™ character (that part's easy) to change its font size, adjust superscript height, etc.
  2. Apply a character style to the preceding character (to remove the additional tracking that the paragraph style applies automatically, so the ™ snuggles up a bit tighter to the preceding word).

I know how to do the first basic search & style part but have no idea how to select the preceding character and apply different formatting to it.

Thanks for any help!

TOPICS
Scripting

Views

406

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
Guide ,
Nov 30, 2016 Nov 30, 2016

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
Advocate ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

Try this:

Bildschirmfoto 2016-12-01 um 09.31.08.png

(?-i)TM      finds a uppercase TM. But also a BEASTMAN, so be careful

.(?=TM)     looks for any character which follows a TM. Apply a negativ kerning there.

Bildschirmfoto 2016-12-01 um 09.36.21.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
Advocate ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

Maybe you cant alter the paragraph style with an GREP, and have to find/search, here is how:

Bildschirmfoto 2016-12-01 um 09.44.17.png

And a useful tip for searches in the future:

If you use brackets ( ) around your "Search" term, you can use $1 to get that back in "Replace".

Example: Find… 

(\d),(\d)     19,95€

Replace

$1.$2     19.95€

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
Advocate ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

LATEST

Aaaarg, damn, found BeasTMan instead 🙂

51xkr7a-CBL.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