$re = '/(\s*boolean visible = false)|(.*)/';
$str = ' type dw_3 from u_dw within w_pg6p0012_01
boolean visible = false
integer x = 1797
integer y = 388
integer width = 887
integer height = 112
integer taborder = 0
boolean bringtotop = true
string dataobject = "d_pg6p0012_14"
end type
type dw_3 from u_dw within w_pg6p0012_01
integer x = 1797
integer y = 388
integer width = 887
integer height = 112
integer taborder = 0
boolean bringtotop = true
string dataobject = "d_pg6p0012_14"
end type';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php