Home  >  Article  >  Backend Development  >  正则匹配问题,求前辈指导

正则匹配问题,求前辈指导

WBOY
WBOYOriginal
2016-06-23 14:10:25919browse



什么样的正则表达式可以将value的值得到?

求前辈指导,不胜感激。


回复讨论(解决方案)

preg_match('/value="(.+?)"/','',$m);
echo $m[1];

preg_match('/value="(.+?)"/','',$m);
echo $m[1];
我问的问题不对..嘿嘿  
比如说有这么多









从这么多里面匹配到里面的value值

$s=<<<txt<input type="hidden" name="tpl" value=""/><input type="hidden" name="tn" value=""/><input type="hidden" name="pu" value=""/><input type="hidden" name="ssid" value=""/><input type="hidden" name="from" value=""/><input type="hidden" name="bd_page_type" value=""/><input type="hidden" name="uid" value="1368705235817_885"/><input type="hidden" name="type" value=""/><input type="hidden" name="regtype" value=""/>txt;preg_match('/name="uid" value="(.+?)"/',$s,$m);echo $m[1];
 

$s=<<<txt<input type="hidden" name="tpl" value=""/><input type="hidden" name="tn" value=""/><input type="hidden" name="pu" value=""/><input type="hidden" name="ssid" value=""/><input type="hidden" name="from" value=""/><input type="hidden" name="bd_page_type" value=""/><input type="hidden" name="uid" value="1368705235817_885"/><input type="hidden" name="type" value=""/><input type="hidden" name="regtype" value=""/>txt;preg_match('/name="uid" value="(.+?)"/',$s,$m);echo $m[1];
 
谢谢大神...可以了    非常感谢!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn