It's rarely if ever correct to use a reluctant quantifier as the last thing in a regex. In this regex:
/(Round\s+\d+)(.*?)/s
...the first thing the (.*?)
part does is try to match zero characters. That's a perfectly legal match, and because the quantifier is reluctant, it stops right there. If you're going to do it this way, there has to be something after the (.*?)
, like this:
/(Round\s+\d+)(.*?)(Round\s+\d+)/s
This way, the (.*?)
can't stop at zero characters; it has to keep matching consuming characters until it reaches a spot where the next part of the regex - (Round\s+\d+)
- can take over. But you don't want to use that regex because it consumes part of what's supposed to be the next match. Sticking to this format, you can use a lookahead as the ending condition:
/(Round\s+\d+)(.*?)(?=Round\s+\d+|$)/s
Now it's forced to match a whole entry, but the match position is left at the beginning of the next entry so the next match attempt will start there. (EDIT: added |$
to the lookahead to match the last entry.)
EDIT: I meant to comment on your other regex, too:
/(Round\s+\d+)((?!Round).*?)/s
Here, instead of using a positive lookahead as the ending condition, it looks like you're trying to use a preemptive negative lookahead. For that to work, the lookahead has to be performed at each position before the dot is allowed to consume a character. That means the dot has to be enclosed in parentheses with the lookahead, with the quantifier outside them:
/(Round\s+\d+)((?:(?!Round).)*)/s
You can't use a reluctant quantifier in this regex either, for the same reason as the other one.
There's probably a better way to do this, but I would need to know more about the data and your requirements before I could suggest anything.
(Note that I used Perl-like syntax, with the slash delimiters and trailing 's' modifier for single-line mode, because regexes tend to confuse the site's syntax highlighter without them.)