php 正则表达式问题 sffsf(5545555)帮忙用正则表达式把括号里面的内容提出来返回结果是5545555 php的谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 preg_match('/\(\d+\)/', $string, $matches);print_r($matches); preg_match('/\(\d+\)/', $string, $matches);print_r($matches); 里面带字母就不行了,能不能改下 $str = "sffsf(5545555)";preg_match("/\(.*\)/",$str,$match);var_dump($match); 再帮下把dsghdgf<84556632>这种情况也提出来返回结果84556632 preg_match('/\((.*?)\)/', $string, $matches);print_r($matches); preg_match('/<(.*?)>/', $string, $matches);print_r($matches);下面的兼容 (), <>preg_match('/\(|<(.*?)\)|>/', $string, $matches);print_r($matches); $str = "sffsf(5545555)";preg_match('/(?<=\()\d+(?=\))/', $str, $matches);print_r($matches);//多个的时候$x = preg_replace('/^[^(]+\(([^)]+)\).*$/',"$1",$str);print($x);//如果你只有1个括号需要取 IE9下样式加载不上 用PHP正则表达式清除字符串的空白 PHP中$link=mysql_connect("localhost","root",""); 为何连接错误? 新手学PHP,请各位帮忙!!!!!!!!! discuz7.0二次开发问题 PHP入门显示问题 如何用php向服务器已存在的zip文件中增加一个文件 招聘PHP高级程序员 SOS,新手求救 我只在自己的电脑上学习PHP(学习它的语法),只装PHP的编译器可以吗?装好以后应该怎样使用它来写PHP的源程序,和编译它。 MYSQL语句错误 再开帖请教.和+
print_r($matches);
print_r($matches);
里面带字母就不行了,能不能改下
preg_match("/\(.*\)/",$str,$match);
var_dump($match);
返回结果84556632
print_r($matches);
print_r($matches);
下面的兼容 (), <>
preg_match('/\(|<(.*?)\)|>/', $string, $matches);
print_r($matches);
preg_match('/(?<=\()\d+(?=\))/', $str, $matches);
print_r($matches);//多个的时候
$x = preg_replace('/^[^(]+\(([^)]+)\).*$/',"$1",$str);
print($x);//如果你只有1个括号需要取