I want to replace the 4th pattern only in a preg_replace.
This has nothing to with XML, so Im not looking for a DOM solution - just wanted to give a good example string
That's pretty much how to do it. You could cut down the runtime of your code by using some possessive quantifiers and instead of those .*? being a bit more specific in what to match. But in doing so, you'll make the regex more difficult to interpret and if your strings will be fairly small, you might not even notice the difference.
Anyway, here a (slightly) tuned version of what you already cooked up:
Yes, as mentioned, it's called a non-capturing parenthesis. When you do "(.*)" everything the .* matches will be remembered by the regex engine and can possibly be recalled upon by a back reference \1 or $1. Writing "(?:.*)" will tell the regex engine to "forget" the matched characters immediately: it will improve the run-time of the matching.