I am presented with an HTML document similar to this in view source mode (the below is simplified for brevity):
My guess is that you are likely designing an expression similar to:
<(?:textarea|select)[\s\S]*?({{variable:system_version}})[\s\S]*?<\/(?:textarea|select)>|<(?:input)[\s\S]*?({{variable:system_version}})[\s\S]*?>
which you might probably want to modify it, and then replace with what you like to replace.
The expression is explained on the top right panel of regex101.com, if you wish to explore/simplify/modify it, and in this link, you can watch how it would match against some sample inputs, if you like.
$re = '/<(?:textarea|select)[\s\S]*?({{variable:system_version}})[\s\S]*?<\/(?:textarea|select)>|<(?:input)[\s\S]*?({{variable:system_version}})[\s\S]*?>/m';
$str = '
System version: 6.0
You are using system version 6.0
This was the content of the welcome block.
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
var_dump($matches);
jex.im visualizes regular expressions:
<(?:textarea|select)[\s\S]*?>[\s\S]*?<\/(?:textarea|select)>|<(?:input)[\s\S]*?>
^<(?:input)[\s\S]*?({{variable:system_version}})[\s\S]*?>$
^<(?:input).*?({{variable:system_version}}).*?>$