data: 1
data: 2
data: 3
data: 4
data: 5
(?=.*data)(.*)the result of the transformation would be
data: 1data: 2data: 2data: 2data: 3data: 3data: 4data: 4data: 5data: 5(= first capture group of first match + 2nd match + first capture group of 2nd match + ...)
Answers
The way it is designed it expects one match. It then skips the first capture of the match group (which is the entire match). It then returns a concatenation of the capture groups of the regex. (You do not have any capture groups in your regex). Instead, what you get is the remaining matches as a whole.
If you added a capture group for wat you probably expect to get back, like so: the result of the transformation would be (= first capture group of first match + 2nd match + first capture group of 2nd match + ...)
You will not get the line breaks in the result, unless you change the options, as the dot operator does not match line break characters by default.
Note: the terminology might be confusing, as "capture group" above reffers to the element of the regular expression, not to some .NET data structure / class
I ended up writing a simpler custom transformation, and it ended up behaving like how https://regexr.com/ behaves.