如果我有像这样的字符串"location":"Denton TX"
(包括双引号) 我只想得到Denton TX
。我怎样才能为那件事写正则表达式?正则表达式混淆
我试图
function getInfo($info,$content){
echo 'getting INFO';
preg_match_all("\.".$info."\.:\"[^\"]*(.*?)\.,",$content,$matches,PREG_PATTERN_ORDER);
print_r($matches);
return $matches[0];
}
,我把 '位置' 为$info
,但它不工作。
你有任何错误,如需要[分隔符](http://www.php.net/manual/en/regexp.reference.delimiters.php)? – Wiseguy
没有没有得到任何错误T___T –
其次是缺少分隔符作为问题。另外,http://www.whathaveyoutried.com/ – Adrian