我需要得到字符'.‘和'(’之间的任何字符串--没有引号--但是字符串不应该包含(aA to zZ)、数字(0-9)和下划线以外的字符。
我能在两者之间找到任何东西。和(如下:
$result = preg_match('/\.(.*?)\(/', $str, $matches);但无法过滤匹配的字符串,以获得数字和下划线的字母。
样本字符串:
$str = "class._filter9({opacity:0.5, color:'red'});";我要去找_filter9
你能帮忙吗?谢谢!
发布于 2014-01-08 23:31:40
Regexpal.com为测试regex搜索是否有效提供了奇迹。先生,给您:
$result = preg_match('/\.([a-zA-Z0-9_]+)\(/', $str, $matches);https://stackoverflow.com/questions/21008751
复制相似问题