帮忙写个正则 原始字符串/^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/si目标字符创Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/si这就是个字符串,我想要得到Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows 我的意思是去掉前面的/和后面的/si或者/s $str="/^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/si"; preg_match('(Mozi.*?dows)',$str,$result); echo $result[0];输出:Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows 里面的字符串并不是一定的,比如说/^NFReader\/([0-9\.]+)/si我需要得到^NFReader\/([0-9\.]+ 错了,是这个^NFReader\/([0-9\.]+) $str=<<<EOD/^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/siEOD;preg_match_all('/^\/([\d\D]*)\/[a-z]*/i',$str,$match);var_dump($match); 我写了一个,大家帮我改一改$reg =~ /^\/(\.*)[\/s|\/si]$/si;print($1);输出的结果后面还有/s或者/si,大家帮我改下吧,谢谢 新人请教一个问题 phpmailer问题 分页越来越多,如何能像DZ论坛隐藏起来。 数据库表是gbk,如何保存韩文? utf-8 大小的问题 急问。。。。高手们请进!有分贡上。。。。 Notice: Undefined offset 错误 对于小型php电子商务网站选哪种国外在线支付系统比较好? 请教高手一个问题和HTML有关 驳斥:从两点看PHP/ASP/JSP的区别 大小写转换问题 php代码问题
$str="/^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/si";
preg_match('(Mozi.*?dows)',$str,$result);
echo $result[0];
输出:Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows
我需要得到^NFReader\/([0-9\.]+
$str=<<<EOD
/^Mozilla\/4.0 \(compatible; MSIE ([0-9\.]+); Windows/si
EOD;
preg_match_all('/^\/([\d\D]*)\/[a-z]*/i',$str,$match);
var_dump($match);
print($1);
输出的结果后面还有/s或者/si,大家帮我改下吧,谢谢