在php中使用正则表达式获取值?

How can I get price 1.199,00 from below html using preg_match_all?

`<h4><span class="price_label">Preis:&nbsp;</span>1.199,00 Euro &nbsp;(inkl. 19% MwSt.)</h4>`

Code

<?php
     $pattern = '#'.$regex.'#';
     preg_match_all($pattern, $data, $price);
     print_r(price);
    ?>

This would be a simple example:

<?php
$subject = '<h4><span class="price_label">Preis:&nbsp;</span>1.199,00 Euro &nbsp;(inkl. 19% MwSt.)</h4>';
$pattern = '|<span[^>]+class="price_label".*>[^<]+</span>([0-9.,]+)\s*.*$|';
preg_match($pattern, $subject, $tokens);
var_dump($tokens[1]);

The output obviously is:

string(8) "1.199,00"

Note however that it is questionable to use regular expressions to parse HTML markup or extract values from it. Such solutions tend to be picky, so not robust against minor modifications of the markup. It is far better to use a DOM parser.