0
我有两个正则表达式看起来一个URL,并确定该网址是一个Silverlight视频网址结合升压正则表达式两个正则表达式
URL应该有这些扩展的至少一个在任何地方.isma ,.ismv,.isml
正则表达式:.ISM(一个| v |升)
和
URL应该有字符串 “/ QualityLevels({比特率})/片段(音频= {开始时间})”
正则表达式:/ QualityLevels(\ d +)/片段(\ B(音频|视频|文本)\ b = \ d +)
如何将这两个字符串合并为一个并确保两个条件都满足?
is_silverlight_livestream_url(const char *url)
{
/* expecting something that ends with
* "xxx.isml/QualityLevels(<bitrate>)/Fragments(<type>=<timecode>)"
* on-demand streams have the extension ".ism" instead of ".isml"
*/
static boost::regex regex(my_regex_str);
try {
if (boost::regex_match(url, regex) == true) {
return true;
}
} catch (std::runtime_error e) {
}
return false;
}
Santhosh
嗨罗斯,这是我的网址
– Santhosh 2013-04-01 22:14:21,这些都是我的网址'/PRCSTest1.isml/Events(2013_6_3_23_19_41_968)/ QualityLevels(64000)/片段(音频= 1120130612)' '/live/192.168.10.109_130312210620830hi/QualityLevels(64000)/Frag (音频= 86636270000)/ ProxySessions(240022624).isma'' /live/192.168.10.109_130312210620830hi/QualityLevels(448000)/ Fragments(video = 86674890000)/ ProxySessions(240022624).ismv',您建议的正则表达式无法工作所有这些网址。 – Santhosh 2013-04-01 22:20:21