$re = '/\:(\s)?(.+)[^\{](\v)/';
$str = '#main h1 {
color: #333;
}
a {
text-decoration: none;
color: #333;
}
a:hover {
text-decoration: underline;
}
body {
margin: 0;
display: table-row;
/*vertical-align: middle;
filter: url(#blur);
background: url(\'bg.jpg\') center top no-repeat #333;
background-clip: cover;
-moz-filter: blur(20px);*/
position: relative;
}
body::before {
content:\'\';
background: url(\'bg.jpg\') center top no-repeat #333;
background-clip:cover;
background-attachment: fixed;
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
height: 100%;
width: 100%;
filter: url(#blur);
filter: blur(2px);
-webkit-filter: blur(2px);
z-index: -1;
}';
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