title: C++ regex - get a link from html code
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;regex&gt;
  
  using namespace std;
  
  int main(int argc, char* argv[]) {
  
       string test = "&lt;html&gt;&lt;div&gt;&lt;script&gt;var link = "http://example.com/?key=dynamic_key";&lt;/script&gt;&lt;/div&gt;&lt;/html&gt;";
  
       regex re("http://example.com/(*)");
       smatch match;
  
       if (regex_search(test, match, re)) {
  
       cout&lt;&lt;"OK"&lt;&lt;endl;
  
       }
  
       return 0;
  }
  </code></pre>
  
  <p>The command for this compile.</p>
  
  <pre><code>root# g++ test.cpp -o test -std=gnu++11
  </code></pre>
  
  <p>This program not working. How do I get the link (use regex) from the html code? Please, help me.</p>