Weil du keine Lookbehind (the matched String) und Lookahead (the matched string) verwendest, sondern nur "the matched string" welcher zu ersetzen ist.
oops^^ das ist mit neu :P
in der docu steht dass man das erfassen mit (?:.+) verhindern könnte, was aber nicht functioniert.
(?: ) ist ein nicht speichernde ($1 ..$99) Gruppe, was du suchst ist im Handbuch beschrieben unter Assertions:
Assertions
An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. The simple assertions coded as \b, \B, \A, \Z, \z, ^ and $ are described above. More complicated assertions are coded as subpatterns. There are two kinds: those that look ahead of the current position in the subject string, and those that look behind it.
An assertion subpattern is matched in the normal way, except that it does not cause the current matching position to be changed. Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example, \w+(?=;) matches a word followed by a semicolon, but does not include the semicolon in the match, and foo(?!bar) matches any occurrence of "foo" that is not followed by "bar". Note that the apparently similar pattern (?!foo)bar does not find an occurrence of "bar" that is preceded by something other than "foo"; it finds any occurrence of "bar" whatsoever, because the assertion (?!foo) is always TRUE when the next three characters are "bar". A lookbehind assertion is needed to achieve this effect.
...
Deine Lektüre.
mfg Beat