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