Like I posted in my comment, you don't want to parse html with a regex. There are VERY few cases where you should. Typically you would use DOMDocument and XPath to query (similar to css) for elements. This will allow you to get the inner text, nested elements and more that regular expressions just can't do well/easily.
However, if you need to, this should work:
<?php
$text =<<<HTML
<div class="share"></div>
<div class="sdfsd share sdfsdfsdf"></div>
<div class="sdfsd dfdgdg" share></div>
<a class="icon-share export-to-csv-button"
<a class="fxac link" href="/share "
HTML;
preg_match_all('/<[^>]*class="[^"]*\bshare\b[^"]*"[^>]*>/i', $text, $matches);
echo '<pre>'.htmlentities(print_r($matches,1)).'</pre>';
Outputs:
Array
(
[0] => Array
(
[0] => <div class="share">
[1] => <div class="sdfsd share sdfsdfsdf">
)
)
which you can see in action here: http://codepad.viper-7.com/UjBvT8
/<[^>]*class="[^"]*\bshare\b[^"]*"[^>]*>/si. This would only work though if the class was surrounded by double quotes.