Replace contextual period

There is a find-replace question in the .vtt file that I want to convert to .srt file.

1
00:00:00.340 --> 00:00:02.800
(SINGING) You started with
a string you need validated.

2
00:00:02.800 --> 00:00:05.660
Used conditionals, and
things got complicated.

in order to make a valid .srt file, I wanna turn all the “.” in timeline into "," ▼

1
00:00:00,340 --> 00:00:02,800
(SINGING) You started with
a string you need validated.

2
00:00:02,800 --> 00:00:05,660
Used conditionals, and
things got complicated.

so I started to learn RegEx rules and make this rule and it works fine in regex101.com

▲ (?:\d{2}:\d{2}:\d{2})(.)(?:\d{3})

But it just doesn't work in the macro~

You’re very close. Try this regex, which uses lookbehind and lookahead instead of non-capturing parentheses, and see if it doesn’t work for you:

(?<=\d{2}:\d{2}:\d{2}).(?=\d{3})

1 Like

It works and thank you so much~~ This is my first time to ask questions here in the KM forum. It’s so great! I gotta learn some “lookbehind and lookahead” related stuff:grin:

Glad to hear it did the trick. This is indeed a great forum, so please don’t hesitate to ask more questions in the future :slightly_smiling_face:

You’re so sweet~