You have the s flag set at regex101.com, but not in KM, so the . character matches newlines at the former, but not the latter. Try modifying the regex in KM to
(?s)([^\n]*)\n+(.*)
so that it includes the flag there as well and it should work.
This works - thanks. The only problem I have is that some of the source text is “formatted” e.g. bolded. The formatting is lost. Are there any tricks to do the regex but retain the source formatting?
If one of the above posts solves your problem/question as originally stated, please check the "Solved" checkbox (click for details) at the bottom of that post.
Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.