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

duplicating a regularly occuring sequence of text immediately after itself

Community Beginner ,
Mar 17, 2018 Mar 17, 2018

Copy link to clipboard

Copied

I’d like to duplicate a sequence of text immediately after itself.  Such sequence regularly occurs in my document. Example below.

Current text

1:1 Lorem ipsum dolor sit amet.

1:2 Consectetur adipiscing elit.

1:10 Sed do eiusmod tempor incididunt ut labore;

14:7 Et dolore magna aliqua,

23:16 Ut enim ad minim veniam.

Note that the 0:0, 0:00, 00:0, 00:00 sequence already has its own character style applied. The sequence will always fit within that formula of 0:0, 0:00, 00:0, 00:00.

Desired outcome

1:11:1 Lorem ipsum dolor sit amet.

1:21:2 Consectetur adipiscing elit.

1:101:10 Sed do eiusmod tempor incididunt ut labore;

14:714:7 Et dolore magna aliqua,

23:1623:16 Ut enim ad minim veniam.

The desire is to duplicate the 0:0, 0:00, 00:0, 00:00 sequence after itself (with no space between the two), and to also apply a new character style to it.

I played around with Text Variables and GREP styling, but couldn’t figure it out. I’m not sure if the solution can be made with those options or if a script is needed. How can this be done? Any help is appreciated. Thank you.

TOPICS
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

correct answers 1 Correct answer

Guide , Mar 17, 2018 Mar 17, 2018

Find: (?s)^(\d+:\d+)\K(\h)

Replace by: $1$2 + Italic

Best,

Michel, from FRIdNGE

Votes

Translate

Translate
Guide ,
Mar 17, 2018 Mar 17, 2018

Copy link to clipboard

Copied

Find: (?s)^(\d+:\d+)\K(\h)

Replace by: $1$2 + Italic

Best,

Michel, from FRIdNGE

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 ,
Mar 17, 2018 Mar 17, 2018

Copy link to clipboard

Copied

LATEST

That worked brilliantly! Thank you very much Michel!

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