$re = '/@import.+;/i';
$str = '# Drupal core/tests/Drupal/Tests/Core/Asset/css_test_files/css_input_with_import.css
@import "import1.css";
@import "import2.css";
@import url("http://example.com/style.css");
@import url("//example.com/style.css");
# Examples from https://developer.mozilla.org/en-US/docs/Web/CSS/%40import
@import url("finep;rint.css") print;
@import url("bluish.;css") projection, tv;
@import \'cust;om.css\';
@import url("chrome://communi;cator/skin/");
@import "common.css" screen, projection;
@import url(\'landscape.css\') screen and (orientation:landscape);
# Examples using htmlentities
@import \'https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display&subset=latin-ext\';
@import "https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display&subset=latin-ext";
@import url("https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display&subset=latin-ext");
@import url("https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display&subset=latin-ext") tv;
@import url("https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display&subset=latin-ext") only screen and (max-width:639px) and (orientation: portrait);
# Additional
@import "cu\'st;om.css";
@import \'cus(t;om.css\';
@import \'cus)t;om.css\';
@import \'cus(t);om.css\';
@import url(http://example.com/cu\'st;om.css);
@import url(http://example.com/cus(t;om.css);
@import url(http://example.com/cus)t;om.css);
@import url(http://example.com/cu(s)t;om.css);
';
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