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

GREP for ;

New Here ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

I have the following line:

Autor 1; Autor 2; Autor 3

How to use GREP to find the "Autor 1" and add a character style to it?

Thanks in advance.

TOPICS
Scripting

Views

269

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 ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Hi,
is this a scripting question?


If yes, would you like to use InDesign's GREP functionality or a simple RegExp statement on a string?

Does "Autor 1" stand for a variable that can hold any name?

Tell us more about the position of "Autor 1;" in the text flow.

Could it be everywhere? Or just at the beginning of a paragraph?

Other specifics?

Regards,
Uwe

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 ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

LATEST

Hi,

You can use a findGrep formula like

^.*?(?<=;)     for including semicolon

or

^.*?(?=;)     to match without semicolon

I suggest to run it with a selection as a target since this is very general condition (many matches possibly)

but

I would recommend to use nested paragraphStyle to keep this format in dynamic mode

use a condition:     upto 1st occurrence of semicolon

Jarek

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