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.
Find: (?s)^(\d+:\d+)\K(\h)
Replace by: $1$2 + Italic
Best,
Michel, from FRIdNGE
Copy link to clipboard
Copied
Find: (?s)^(\d+:\d+)\K(\h)
Replace by: $1$2 + Italic
Best,
Michel, from FRIdNGE
Copy link to clipboard
Copied
That worked brilliantly! Thank you very much Michel!