日期:2014-05-17 浏览次数:20512 次
<input type="text" class="shareIpt j-copyipt" value="xxxxxxxxxxxxxxxxxxxxxxx">
[User:root Time:14:58:15 Path:/home/liangdong/php]$ cat preg.php
<?php
$str = <<<EOF
<input type="text" class="shareIpt j-copyipt" value="xxxxxxxxxxxxxxxxxxxxxxx">
EOF;
$nmatches = preg_match('/class="shareIpt j-copyipt" value="(.*)"/iUs', $str, $matches);
echo $matches[1] . PHP_EOL;
?>
[User:root Time:14:58:16 Path:/home/liangdong/php]$ php preg.php
xxxxxxxxxxxxxxxxxxxxxxx