I am using notepad++ and RegEx.
I have a SRT file and I want to add three question marks “???” whenever the first the three characters of a line are also three questions marks “???”. However, I only wish to do this if the next line is blank. However, if the next line is not blank then I would like to add the ??? after the end of that next line.
For example this is that I have.
14
01:04:21,406 --> 01:04:24,887
??? Face I'd never see again
15
01:04:24,885 --> 01:04:27,638
??? It's a shame to awake
in a world of pain
Now I would like to add the ??? like this to both the lines.
14
01:04:21,406 --> 01:04:24,887
??? Face I'd never see again ???
15
01:04:24,885 --> 01:04:27,638
??? It's a shame to awake
in a world of pain ???
Notepad++ used to have problems with multiline matches, but the current releases are said to support Perl-style regexes much better. I don’t have Notepad++ installed, but if its regex engine works correctly, then the following regex should solve your problem:
Search for
(?s)^(\?{3}.*?(?=\r?\n\r?\n|\z))and replace with\1???.Explanation: