PHP 正则匹配 在线等
如 匹配这个input 中的 value
- HTML code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
——解决方案——————–
‘/<input.*? class="shareIpt j-copyipt" value="([^\"]+)"/'
——解决方案——————–
- PHP code
[User:root Time:14:58:15 Path本文来源gao!%daima.com搞$代*!码$网3
搞代gaodaima码:/home/liangdong/php]$ cat preg.php <?php$str = <<<EOFEOF;$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