I have a simple ifstream code for reading a html file.
#include <fstream>
#include <iostream>
using namespace std;
int main () {
char data[100];
//open a file in read mode.
ifstream infile;
infile.open("html9.html");
while(infile >> data)
cout << data << endl;
infile.close();
return 0;
}
Basically I like to search for tr
tag followed by search for td
tag then replace whatever inside the td
tag with my own data. My html table
tag is like this
<table>
<tr>
<td>
#Title
</td>
<td>
#Info
</td>
<tr>
<td></td>
</tr>
</tr>
</table>
The html can be large file so my table
tag will eventually require some searching. I need the flexibility of regex so I like to know can I use some sort of regex with istream object (istream is only which I like to use).
Sorry if I jumped right into requiring some example code and some explanation about istream and embedding regex with it but I really couldn't find any place on internet where I can also find this with example and step by step explanation.
Thanks for reading