Friday 15 April 2011

Combining two regular expressions in boost regex -


I have two regular expressions that look at the URL and determine that the URL is a watchlite video URL

  1. The URL should contain at least one of these extensions, where .isma, .ismv, .isml

    Regex: .ism (a | v | l) < / P>

    1. URL "string" / quality level ({bitrate) / pieces (audio = {start-time} ) Should be "

      Regex: / quality level (\ d +) / pieces (\ b (o) Dio | Video | Text) \ b = \ d +)

      How do I add these two stars in one and ensure that both the conditions are satisfied?

        is_silverlight_livestream_url (const char * url) {/ * * xxx.isml / QualityLevels (& lt; bitrate & gt;) / pieces ( = & lt; timecode & Gt;) "* On-demand stream has an extension" .isml "* / static boost :: regex regex (my_regex_str); Try (if (boost :: regex_match (url, regex) == true) {back to true ;}} Hold (std :: runtime_error e) {} return false;}   

      satisfaction

      You have to do something where you search for a string, after that (optional) additional characters (you can be more specific if you know that this How to see the URL) and then file extension at the end:

        / quality (\ D +) / pieces (\ b (audio | video | text) \ b = \ d + ) (. +?)?. Ism (a | v | l)    

No comments:

Post a Comment