需要一条正则,请问大家怎么用正则来匹配这个feed_require 冒号后面的内容,望高手指教,谢谢!
"feed_require":"a:0:{}","is_feed":"1","online":"1","search_type":"2","right_picture":"a:2:{s:13:\"right_pic_url\";s:57:\"http:\/\/www.sinaimg.cn\/blog\/miniblog\/media\/radio\/12334.jpg\";s:14:\"right_link_url\";s:49:\"http:\/\/video.sina.com.cn\/z\/weiboradio\/index.shtml\";}"
"feed_require":"a:0:{}","is_feed":"1","online":"1","search_type":"2","right_picture":"a:2:{s:13:\"right_pic_url\";s:57:\"http:\/\/www.sinaimg.cn\/blog\/miniblog\/media\/radio\/12334.jpg\";s:14:\"right_link_url\";s:49:\"http:\/\/video.sina.com.cn\/z\/weiboradio\/index.shtml\";}"
string result=Regex.Match(jsonstr,@"feed_require":"?<txt>([^""]*?)").Groups["txt"].Value;不过建议用json解析
string result=Regex.Match(jsonstr,@"right_picture":"?<txt>([^""]*?)").Groups["txt"].Value;
string jsonstr="你的字符串";
string result=Regex.Match(jsonstr,@"""right_picture"":"(?<txt>.*?)""(?=,|$)").Groups["txt"].Value;