Extract data from CURL using regex in C Programing
<p>I am trying to extract data from CURL output by using regex. I can parse the HTML source of a webpage and save it in a text file. But, before saving it, I want to remove all the <code>&lt;script&gt;</code> tag from the output. This is the program :- (bbb.txt is the output text file)</p>

<pre><code>int main(void) {
    CURL *curl;
    FILE *fp;
    CURLcode res;
    char *url = "google.com";
    char outfilename[FILENAME_MAX] = "bbb.txt";
    curl = curl_easy_init();
    if (curl) {
        fp = fopen(outfilename,"wb");
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_USERAGENT, "Developer/1.0");
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
        res = curl_easy_perform(curl);

        curl_easy_cleanup(curl);
        fclose(fp);
    }
    return 0;
}
</code></pre>