#include <iostream>
#include <string>
#include <regex>
usingnamespace std;
[code]void main()
{
string temp; // Save "Hello everyone! I am John"
temp.resize(500);
char REGEX[500]; // Save [A-Z]o
FILE *fi,*fo;
//
fi = fopen("input.txt","rt");
fscanf(fi,"%[^\n]\n",®EX);
regex rg(REGEX); // Save REGEX into regex
char s;
int i = 0;
int ntemp = 0; // elements number of temp
while (!feof(fi))
{
if (fscanf(fi,"%c",&s) > 0)
temp[i] = s;
i++;
ntemp++;
}
temp[ntemp] = '\0';
/////// What should i do here ??????????
fo = fopen("output.txt","wt");
fcloseall();
}
[/code]
I need to find in tmp the fist position that matches regex.... What should i do???