$re = '/\[div(?:\sid=["|\'](.*?)["|\'])?(?:\sclass=["|\'](.*?)["|\'])?\](.*?)\[\/div\]/ms';
$str = 'sdfsdfsd
adafadfalkjdafdfa
[div id="bla" class="ups"]some multiple line text[/div]
[div class="bla"]some multiple line text
more lines
[/div]
[div id="first"]
some text
[/div]
Ovo ne bi trebalo da fatga
[div id="bla"]
On the other hand, and in terms of severity, **DNS or NS takeovers** are less common but create the highest impact. An NS subdomain takeover is similar in principle to other types of subdomain takeovers. And due to the major role that NS records play in internet traffic, and the possibility of attackers chaining multiple attack vectors, an NS takeover can lead to severe implications for the target organization.
*For our new blog series [Blast Radius][4], security professionals, researchers and experts deep dive into different attacks and vulnerabilities, explore how they can impact the entire internet ecosystem, and examine what they mean for organizations of all sizes, across all industries. To talk about the growing danger of DNS takeovers, we are joined by Patrik Hudák.*
poop
[/div]
adfadfadfadfaf';
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