I have two regular expressions which looks up a url and determines if the URL is a silverlight video url
URL should have at least one of these extensions any where .isma, .ismv, .isml
Regex: .ism(a|v|l)
and
URL should have the string "/QualityLevels({bitrate})/Fragments(audio={start-time})"
Regex: /QualityLevels(\d+)/Fragments(\b(audio|video|text)\b=\d+)
How do I combine these two strings into one and make sure that both the conditions are satisfied?
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